SLMs · 7 min read
Training a small summarisation model for context compression
How to distil a large model's summarisation skill into a small model you can run cheaply on every agent turn: the data, the training recipe, the faithfulness problem, and how to evaluate it properly.
In our post on prompt and context compression, we suggested using a small model to summarise an agent’s older conversation turns, and promised to come back to how you train one. This is that post.
The idea is simple. A large model writes good summaries but is expensive to call on every turn. A small model is cheap but, out of the box, writes worse summaries. Distillation closes the gap: you use the large model (the teacher) to produce examples of the summaries you want, then fine-tune the small model (the student) to imitate them.
The hard parts are not the training script. They are deciding what a “good” summary is, building clean data, and proving the student doesn’t quietly drop or invent facts.
Is it worth training one?
Start by checking whether you need to. Microsoft’s ACON paper (presented at ICML 2026) found that a smaller hosted model, gpt-4.1-mini, worked as an agent context compressor without any distillation. Prompting a small off-the-shelf model is the cheapest first step.
Training your own makes sense when:
- Volume is high. The summariser runs on every long session, so per-call cost adds up.
- Data must stay in-house. A model on your own infrastructure means history never leaves it.
- Your format is specific. You need a fixed structure (decisions, IDs, open tasks) that general models follow inconsistently.
ACON gives a sense of the economics. Its authors report that a gpt-4.1 compressor cost about $0.045 per example, while a distilled Qwen3-14B compressor cost about $0.0004, roughly a 99% reduction.
Step 1: Write the summary contract
Before generating any data, define exactly what the summary must contain. For agent context, a structured format works far better than free prose, because you can check it:
Goal: what the user is trying to achieve
Decisions: what has been agreed, with exact numbers
Facts: IDs, names, dates, values the agent must not lose
Tool state: what was called, what came back, what failed
Open items: what is still unresolved
This contract becomes the teacher’s prompt, the student’s target format and your evaluation checklist. Change it later and you will need to regenerate data, so it pays to settle it early.
ACON adds a useful twist: rather than hand-writing the compression instructions, it optimises them. The agent runs tasks with and without compression; where the full context succeeds but the compressed one fails, a strong model compares the two and writes feedback on what the compression lost, and the instructions are updated. A second pass removes information the agent never used, making summaries shorter. The authors report this optimisation cost under $2 per benchmark. You can apply the same loop by hand: collect failures, ask “what did the summary drop?”, and fix the contract.
Step 2: Generate teacher data
You need inputs (real conversation histories, tool traces, documents) and teacher summaries of them.
Use real inputs. Sample from your own logs, not synthetic chats. The EMNLP 2023 Select, Prompt, Filter paper on distilling ChatGPT into smaller conversation summarisers shows why the details matter:
- Select in-domain conversations from a large unlabelled pool using semantic similarity.
- Prompt the teacher with similar, human-checked examples retrieved from a small labelled set.
- Filter out low-quality teacher outputs before training.
Compared with standard distillation on the same amount of data, the authors report up to 6.6 points higher ROUGE-2. The lesson is that relevant inputs and good few-shot examples beat sheer volume.
Filter hard. Teacher models make mistakes too, and the student will learn them. Cheap filters catch a lot:
- Reject summaries missing required sections.
- Reject summaries that contain numbers, IDs or names not present in the input.
- Run a fact-checker (see Step 5) and drop anything with unsupported claims.
Cover the edges. Include very long histories, histories with failed tool calls, and short ones where the right answer is “almost nothing to summarise”.
Step 3: Fine-tune the student
For most teams, supervised fine-tuning with LoRA adapters is enough. It is what ACON used: teacher (gpt-4.1) outputs as targets, a standard cross-entropy loss, and LoRA on Qwen3-14B, Qwen3-8B and Phi-4.
A training record is just the input and the teacher’s summary in your chat format:
{"messages": [
{"role": "system", "content": "<your summary contract>"},
{"role": "user", "content": "<conversation history to compress>"},
{"role": "assistant", "content": "<filtered teacher summary>"}
]}
Hold out a test set drawn from different sessions (and ideally different users or time periods) than the training data, so you are measuring generalisation rather than memory.
Step 4: Train for faithfulness, not just imitation
Imitation teaches the student the format. It doesn’t strongly teach it not to make things up, and smaller models hallucinate more.
The TrueBrief paper (December 2025) tackles this directly for models from 0.5B to 7B parameters (Qwen2.5). Its recipe:
- Take good summaries as the “chosen” answers.
- Create “rejected” answers by deliberately corrupting them: swap named entities for false values, or paraphrase sentences with content not grounded in the source.
- Train with Direct Preference Optimization (DPO), so the model learns to prefer the faithful version.
The authors report faithfulness scores improving at every size, for example from 0.72 to 0.77 at 0.5B and 0.81 to 0.86 at 1.5B. Two findings are worth noting. Gains shrank as models got larger. And corruptions that were too heavy made results worse: subtle, realistic errors taught more than obvious ones.
You can run this as a second stage after SFT, reusing your filtered teacher summaries as the chosen answers.
Step 5: Evaluate the way it will be used
ROUGE and similar overlap scores are fine for spotting regressions but say little about whether a summary is useful. Evaluate on three levels.
| Level | Question | How |
|---|---|---|
| Contract | Is every required field present and well-formed? | Simple parser checks |
| Faithfulness | Is every claim supported by the input? | A small fact-checking model, plus spot checks |
| Task | Does the agent still succeed with compressed context? | Run your agent eval with and without compression |
Faithfulness checkers can be small too. MiniCheck (EMNLP 2024) trained compact fact-checkers on synthetic data containing realistic errors generated by GPT-4. Its authors report that a 770M-parameter version reached GPT-4-level accuracy on their LLM-AggreFact benchmark at about 400x lower cost. That makes it practical to check every summary in your test set, and even to filter training data.
The task level is the one that counts. ACON’s evaluation is a good template: run the same agent tasks with full context and with compressed context, and compare both success rate and peak tokens. Its distilled students kept over 95% of the teacher compressor’s performance. With the optimised compressor, the authors report peak tokens cut by 26–54% across benchmarks, while largely keeping task accuracy (on AppWorld, 56.5% compressed versus 56.0% uncompressed; on OfficeBench, 74.7% versus 76.8%). Note that OfficeBench dipped slightly: measure on your own tasks rather than assuming compression is free.
Also add targeted tests for the things that hurt most when lost: a specific order ID, a price agreed ten turns ago, an instruction the user gave once.
Trade-offs and pitfalls
- You inherit the teacher’s blind spots. Distillation copies errors as faithfully as strengths. Filtering is not optional.
- Drift over time. Your agent’s tools and users change; the summariser’s training data doesn’t. Re-sample and retrain periodically.
- Small models summarise worse on long, messy input. Test on your longest sessions, not the median.
- Contract changes are expensive. Adding a field means regenerating data and retraining.
- Detection is harder than prevention. TrueBrief also tried detecting hallucinations from the small model’s internal signals; on the RAGTruth benchmark its detectors scored below a larger dedicated baseline. Don’t rely on the summariser to flag its own mistakes.
- Keep the originals. Log uncompressed history so you can tell whether a bad answer came from the agent or the summariser.
Where to start
- Try prompting first. Use a small hosted or open model with your structured contract and measure task success with and without compression.
- Collect failures. Where compressed runs fail, find what the summary dropped and update the contract.
- Build a few thousand teacher examples from real logs, with few-shot prompts and strict filters.
- Fine-tune with LoRA, then add a DPO stage with corrupted summaries if faithfulness is weak.
- Gate releases on a task-level eval plus a small fact-checker, and retrain on fresh data every few months.
A small, well-trained summariser can make long-running agents much cheaper. Just treat it like any other model in production: measured, monitored and never trusted blindly.