Liquid AI
LFM2-350M-Extract
A 0.4B model by Liquid AI that uses tools such as web search.
Tools- Downloads
- 93,239 downloads last month
- Likes
- 40 likes
- Uploaded
- Uploaded 5 Sept 2025
Overview
From LiquidAI/LFM2-350M-Extract- Parameters
- 354,483,968 (0.4B)
- Context length
- 128,000 tokens
- Architecture
- lfm2
- Task
- text-generation
- Licence
- lfm1.0
- Released
- 3 Sept 2025
- Last updated
- 30 Mar 2026
This is LiquidAI's upload of LiquidAI/LFM2-350M-Extract, which is based on LiquidAI/LFM2-350M.
Read the licence: lfm1.0
Languages listed in the model card
- English
- Arabic
- Chinese
- French
- German
- Japanese
- Korean
- Spanish
Tools
Uses tools, so web search and the browser work best with it.
Each version is the same model stored at a different precision: smaller files use less memory and lose a little quality.
| Version | File size | File | SHA-256 |
|---|---|---|---|
| Q4_0 | 219.3 MB | LFM2-350M-Extract-Q4_0.gguf | |
| Q4_K_M | 229.3 MB | LFM2-350M-Extract-Q4_K_M.gguf | |
| Q5_K_M | 260.4 MB | LFM2-350M-Extract-Q5_K_M.gguf | |
| Q6_K | 293.4 MB | LFM2-350M-Extract-Q6_K.gguf | |
| Q8_0 | 379.2 MB | LFM2-350M-Extract-Q8_0.gguf | |
| F16 | 711.5 MB | LFM2-350M-Extract-F16.gguf |
Architecture
From config.json in LiquidAI/LFM2-350M-Extract- Model class
- Lfm2ForCausalLM
- Model type
- lfm2
- Layers
- 16
- Hidden size
- 1024
- Attention heads
- 16
- Key/value heads
- 8
- Vocabulary
- 65,536
- Context length
- 128,000 tokens
- Weights
- float32
Papers and data
From LiquidAI/LFM2-350M-ExtractPapers the model's Hugging Face page links to (the model's own report and papers it cites).
LFM2-350M-Extract
Based on LFM2-350M, LFM2-350M-Extract is designed to extract important information from a wide variety of unstructured documents (such as articles, transcripts, or reports) into structured outputs like JSON, XML, or YAML.
Use cases:
- Extracting invoice details from emails into structured JSON.
- Converting regulatory filings into XML for compliance systems.
- Transforming customer support tickets into YAML for analytics pipelines.
- Populating knowledge graphs with entities and attributes from unstructured reports.
You can find more information about other task-specific models in this blog post.
馃搫 Model details
Generation parameters: We strongly recommend using greedy decoding with a temperature=0.
System prompt: If no system prompt is provided, the model will default to JSON outputs. We recommend providing a system prompt with a specific format (JSON, XML, or YAML) and a given schema to improve accuracy (see the following example).

Supported languages: English, Arabic, Chinese, French, German, Japanese, Korean, Portuguese, and Spanish.
Chat template: LFM2 uses a ChatML-like chat template as follows:
<|startoftext|><|im_start|>system
Return data as a JSON object with the following schema:\n[...]<|im_end|>
<|im_start|>user
Caenorhabditis elegans is a free-living transparent nematode about 1 mm in length that lives in temperate soil environments.<|im_end|>
<|im_start|>assistant
{
"species": "C. elegans",
"genus": "Caenorhabditis",
"description": "A free-living transparent nematode about 1 mm in length that lives in temperate soil environments.",
[...]{<|im_end|>
You can automatically apply it using the dedicated .apply_chat_template() function from Hugging Face transformers.
Warning
鈿狅笍 The model is intended for single-turn conversations.
The data used for training these models was primarily synthetic, which allowed us to ensure a diverse data mix. We used a range of document types, domains, styles, lengths, and languages. We also varied the density and distribution of relevant text in the documents. In some cases, the extracted information was clustered in one part of the document; in others, it鈥檚 spread throughout. We applied the same approach of ensuring diversity when creating synthetic user requests and designing the structure of the model outputs. The data generation process underwent many iterations, incorporating ideas and feedback from across the Liquid AI team.
馃搱 Performance
We evaluated LFM2-Extract on a dataset of 5,000 documents, covering over 100 topics with a mix of writing styles, ambiguities, and formats. We used a combination of five metrics to capture a balanced view on syntax, accuracy, and faithfulness:
- Syntax score: Checks whether outputs parse cleanly as valid JSON, XML, or YAML.
- Format accuracy: Verifies that outputs match the requested format (e.g., JSON when JSON is requested).
- Keyword faithfulness: Measures whether values in the structured output actually appear in the input text.
- Absolute scoring: A judge LLM scores quality on a 1-5 scale, assessing completeness and correctness of extractions.
- Relative scoring: We ask a judge LLM to choose the best answer between the extraction model鈥檚 output and the ground-truth answer.

LFM2-350M-Extract outperforms Gemma 3 4B at this task, a model more than 11x its size.
馃弮 How to run
- Hugging Face: LFM2-350M
- llama.cpp: LFM2-350M-Extract-GGUF
- LEAP: LEAP model library
You can use the following Colab notebooks for easy inference and fine-tuning:
| Notebook | Description | Link |
|---|---|---|
| Inference | Run the model with Hugging Face's transformers library. | |
| SFT (TRL) | Supervised Fine-Tuning (SFT) notebook with a LoRA adapter using TRL. | |
| DPO (TRL) | Preference alignment with Direct Preference Optimization (DPO) using TRL. | |
| SFT (Axolotl) | Supervised Fine-Tuning (SFT) notebook with a LoRA adapter using Axolotl. | |
| SFT (Unsloth) | Supervised Fine-Tuning (SFT) notebook with a LoRA adapter using Unsloth. |
馃摤 Contact
- Got questions or want to connect? Join our Discord community
- If you are interested in custom solutions with edge deployment, please contact our sales team.
Citation
@article{liquidai2025lfm2,
title={LFM2 Technical Report},
author={Liquid AI},
journal={arXiv preprint arXiv:2511.23404},
year={2025}
}
More from Liquid AI
On Hugging Face
Everything on this page comes from these pages and is refreshed every few hours; Hugging Face always has the latest.