Post-Training Small LLMs for Agent Capabilities: A Practical Guide
This article explains why a sparse model can post a large jump in agent performance without any change in total or active parameter count, and what that means for engineering teams. It breaks agent capability into four measurable dimensions, shows a minimal sandboxed evaluation loop, and covers train-inference consistency, tool schema versioning, interface and tool-ecosystem adaptation, tiered reasoning effort, and a per-task cost model that accounts for prefix caching. A final checklist covers building an internal eval set, tiered routing, prefix stabilization, output constraints, canary rollout, and failure-sample retention.
1. Why Capabilities Jump When the Architecture Stays the Same
In one model version iteration, both total and active parameter counts stayed unchanged (for example, a sparse architecture with roughly 284B total and 13B active parameters). Only post-training was redone, yet agent benchmarks showed a clear jump, even surpassing a larger preview release in the same series. The takeaway: under a sparse architecture, active parameters determine the compute budget per forward pass, while post-training determines where that budget is spent.
Think of it as keeping the hardware and rewriting the scheduling policy. Pre-training sets the ceiling and distribution of the model’s knowledge; post-training (supervised fine-tuning, preference optimization, reinforcement learning with verifiable rewards, and so on) shapes the problem-solving workflow: whether the model restates the requirement first, whether it proactively calls tools, whether it falls back and retries after a failure, whether it keeps output length under control. Agent tasks depend heavily on exactly these workflow-level capabilities, so the gains from post-training are amplified.
Two practical implications:
- When evaluating a model, parameter count is not enough; look at its workflow capability in your target scenario.
- When a version number changes but parameters do not, rerun your own evaluation set instead of reusing old conclusions.
2. Four Observable Dimensions of Agent Capability
“Improved agent capability” is too vague to act on. In engineering terms, it should be decomposed into measurable metrics:
- Tool call correctness: whether the argument structure matches the contract, whether required fields are missing, whether types are out of range.
- Multi-step planning and state retention: whether early constraints are lost in long chains, whether the goal is still remembered at step N.
- Failure recovery: whether the model can read an error message and correct course instead of repeating the same ineffective action.
- Output economy: whether token consumption for the same task stays stable, and whether a verbose chain of thought leaks into the final output.
A minimal evaluation loop looks like this:
def run_task(model, task, max_steps=12):state = {"goal": task.goal, "history": []}for step in range(max_steps):action = model.act(state) # structured output: tool name + argumentsresult = sandbox.call(action) # controlled sandbox executionstate["history"].append((action, result))if result.done:return score(result, state)return score(None, state) # timeout counts as failure
The key is sandbox isolation and replayability: only when the execution environment is controlled and logs can be replayed can you separate “the model is the problem” from “the environment is the problem.”
3. Train-Inference Consistency: The Value of an In-House Eval and Execution Framework
When evaluation and production execution share one framework, the tool description format, history truncation policy, and error propagation method stay identical on both the training and inference sides. That significantly reduces the gap between high eval scores and degraded production behavior. This is the long-term value of an in-house framework: it does not replace industry-standard interfaces, but provides a controlled, observable, reproducible loop.
A minimal tool description contract:
{"name": "search_docs","parameters": {"type": "object","properties": {"query": {"type": "string"}},"required": ["query"]}}
Engineering advice: put tool schemas under version control, and trigger a regression evaluation on any field change. Also keep a failure sample set as the data source for the next round of post-training.
4. Interface Shapes and Tool Ecosystem Adaptation
Model capability only lands if the interface shape is aligned first. Beyond the general chat completion shape, the industry commonly offers response-style APIs built around input content plus structured entries, which makes it easier to organize tool calls and state updates as explicit objects. Meanwhile, mainstream AI coding tools each define their own context injection and patch application rules, so the model side needs targeted adaptation to reliably produce changes that can be applied directly.
General points for the adaptation layer:
- Context budget allocation: system prompt, repository retrieval snippets, and conversation history need explicit quotas so history does not crowd out critical code.
- Patch format tolerance: parse diff-style output leniently and validate it a second time; if parsing fails, fall back to restating the intended change.
- Idempotent retries: retrying the same request must not produce duplicate side effects, so the tool side needs an idempotency key.
5. Tiered Reasoning Effort and the Cost Model
Making reasoning effort a low/medium/high tier is a direct way to balance cost and quality: simple retrieval and formatting go to the low tier, cross-file changes go to medium or high. Record results per tier during evaluation, because the ranking in the middle tier and the top tier can be completely different, and looking at a single tier leads to misjudgment.
On the cost side, unit price alone is misleading; look at total cost per task:
cost per task ≈ (input tokens × input price + output tokens × output price) × (1 - cache hit rate × cache discount)
Cache hit rate (reuse of repeated prefixes) is often underestimated. When the system prompt and repository context are highly repetitive, a high hit rate can cut actual spend by an order of magnitude. So model selection should weigh cache discount strength and output length control together, rather than staring at input price alone. An example price structure is 1 CNY per million input tokens and 2 CNY per million output tokens, with roughly a 98% cache discount, which comes out well below alternatives with similar intelligence but higher unit prices.
6. Implementation Checklist
- Build an in-house eval set: cover tool calling, multi-file changes, and failure recovery; fix the random seed and the sandbox image.
- Tiered routing: pick reasoning effort by task complexity, and reserve the expensive tier for cross-module refactoring.
- Prefix stabilization: keep the system prompt and tool descriptions in a stable order to maximize cache hits.
- Output constraints: explicitly cap the final answer length and keep long reasoning on an internal channel.
- Canary and rollback: roll out a new version to a small traffic slice first, and compare failure rate and token consumption with the same eval script.
- Retain failure samples: maintain a continuous loop of evaluate, post-train, re-evaluate.
7. Conclusion
A significant capability gain with unchanged parameter count comes down to post-training reallocating active compute toward workflow-level capabilities. For developers, three levers are genuinely under your control: an eval and execution framework with train-inference consistency, an adaptation layer aligned with the tool ecosystem, and a cost structure combining tiered reasoning with cache friendliness. Get those three solid, and you can consistently capture value for money through rapid model iteration instead of being led by a single leaderboard ranking.
