Three Key Directions in LLM Post-Training: Full-Vocabulary Distillation, Generative Reward Models, and XML Tool Calling
This article examines three emerging directions in post-training for large language models: full-vocabulary on-policy distillation, generative reward models, and XML-based tool calling. It covers the core principles behind each approach, practical engineering considerations such as memory constraints, alternating optimization, and parsing reliability, along with a decision framework to help teams evaluate whether to adopt these techniques.
1. Background: Three Technical Directions in Post-Training
Over the past couple of years, improvements in large language model capabilities have increasingly depended on the post-training stage. Pretraining establishes the model’s knowledge base, while post-training determines how the model reasons, judges quality, and interacts with external systems. This article focuses on three directions within post-training:
- Granularity of knowledge distillation: how student models can more fully absorb the distributional information of teacher models.
- Sources of reward signals: whether judging capability can share capacity with generative capability and co-evolve with it.
- Data formats for tool calling: whether structured output can be made more stable when agents interact with external systems.
These three directions look independent, but they all address the same question: how to make models produce more reliable outputs on complex tasks while keeping training and inference costs within acceptable bounds.
2. Full-Vocabulary On-Policy Distillation
2.1 Basic Principles
The common approach to knowledge distillation is to have the student model imitate the teacher model’s outputs. The simplest form uses only the correct answers produced by the teacher—hard labels. A more refined approach uses the teacher’s probability distribution—soft labels.
On-policy distillation goes a step further: the student model generates trajectories from its own distribution, and the teacher model provides its distribution at every position along the same trajectory. The benefit is that training data matches the student’s actual behavior, which mitigates the distribution shift between training and inference.
The full-vocabulary variant computes the KL divergence between teacher and student over the entire vocabulary at each position, rather than using only the top-k tokens or a small sampled subset. This preserves the most complete information and is therefore theoretically the strictest approach. The cost is equally direct: vocabulary sizes are typically on the order of 100,000 tokens, so computing the full distribution demands substantial compute and memory.
2.2 Quantifying the Memory Pressure
Here is a rough estimate of the memory footprint of a full logits tensor. Assume a batch size of 8, a sequence length of 4096, a vocabulary size of 131,072, and 32-bit floating-point storage:
Memory ≈ batch × seq_len × vocab × 4 bytes= 8 × 4096 × 131072 × 4≈ 17.2 GB
That is just a single tensor. Backpropagation also requires storing intermediate activations, and both the teacher and student sides must be computed, so actual usage grows multiplicatively. Whether full-vocabulary distillation can be deployed in practice therefore hinges on whether the implementation can avoid materializing the complete logits in one shot.
2.3 Common Engineering Optimizations
Chunked computation: Split along the sequence dimension, computing full-vocabulary distributions for a small segment of positions at a time and accumulating the loss.
Asynchronous processing of teacher hidden states: The teacher only needs to output hidden states; the projection to vocabulary space can be deferred or executed in batches, reducing the teacher’s resident memory footprint.
Operator fusion: Merge the projection, softmax, and KL computation into a single kernel to reduce intermediate reads and writes.
Communication compression: In multi-GPU training, transmit only the necessary statistics or compressed data to reduce cross-node bandwidth pressure.
The following is illustrative code for chunked computation, omitting distributed and numerical stability details:
# Illustrative code: chunked full-vocabulary KL divergencedef chunked_full_vocab_kl(s_hidden, t_hidden, s_proj, t_proj, chunk_size=512):total = 0.0n = s_hidden.shape[0]for start in range(0, n, chunk_size):end = start + chunk_sizes_logits = s_proj(s_hidden[start:end]) # [chunk, V], gradients kept on the student sidet_logits = t_proj(t_hidden[start:end]).detach() # [chunk, V], no gradient on the teacher sides_logp = log_softmax(s_logits)t_logp = log_softmax(t_logits)# KL(teacher || student), summed over the vocabulary dimensionkl = sum(exp(t_logp) * (t_logp - s_logp), dim=-1)total = total + kl.sum()return total / n
Two caveats are worth noting. First, chunking only reduces the peak memory of a single forward pass; automatic differentiation still stores the computation graph for every chunk. In practice, this is usually combined with gradient checkpointing, which recomputes activations during the backward pass, trading time for memory. Second, the use of detach should be verified against the specific training objective—if the teacher distribution also participates in the optimization, gradients cannot simply be cut off.
2.4 When It Applies
Full-vocabulary distillation suits scenarios where the distribution gap between teacher and student must be captured precisely—for example, transferring reasoning ability or format control—where the training cluster has ample memory and communication bandwidth, and where the team can maintain custom operators. For lightweight instruction fine-tuning, sampled or top-k distillation is usually more cost-effective.
3. Generative Reward Models: Jointly Training Judging and Generation
3.1 Limitations of Traditional Reward Models
In reinforcement learning from human feedback (RLHF), the reward model scores generated outputs. The traditional approach trains a separate discriminative network that takes a prompt and response as input and outputs a scalar score. This structure has two problems: the judging and generating capabilities are independent, so judging standards are hard to keep in sync with generative ability; and scalar scores offer no explanation, making errors difficult to diagnose.
3.2 The Core Idea of Generative Reward Models
Generative reward models (GRMs) treat judging itself as a generation task. The model not only generates answers but also produces evaluations of them—for example, item-by-item checks with reasons—followed by a score or a preference.
The key design point is that generation and judging can share the same parameters. While learning to solve problems, the model also learns to judge whether solutions are correct. The two capabilities reinforce each other, and there is no need to maintain two separate models.
3.3 Alternating Optimization of Generator and Verifier
A common approach to joint training alternates between generation and judging:
Round t:1. The generator samples multiple candidate solutions for a batch of problems2. The verifier (the same model in judging mode) scores or ranks the candidates3. The judging results are turned into rewards to update the generator4. The verifier is updated with more labeled or verifiable samples5. Proceed to round t+1
The advantage of this approach is that training signals upgrade alongside model capability. On verifiable tasks such as mathematics and code, where correctness can be clearly determined, judging results tend to be reliable and can serve as anchors that prevent the judging capability from drifting.
3.4 Key Risks and Mitigations
Self-judging bias: The model may tend to favor its own style of output. Mitigations include introducing external judging samples and running consistency checks on judgments—for example, swapping the order of candidates and comparing whether results remain stable.
Reward hacking: The model may learn to game the judging rules rather than genuinely solve problems. Mitigations include maintaining an independent evaluation set and periodically calibrating with human annotations or verifiable results.
Criterion drift: Over successive iterations, judging standards may gradually deviate from the original targets. Mitigations include fixing a subset of judging samples as a benchmark and monitoring changes in their score distributions.
3.5 Evaluation Recommendations
When evaluating a generative reward model, it is advisable to look at three types of metrics simultaneously: agreement between judgments and human annotations, the actual performance of generated outputs on a held-out set, and whether the judging rationale can be reviewed by humans. Relying on any single metric easily leads to misleading conclusions.
4. Tool Calling: From JSON to XML
4.1 The Basic Tool Calling Workflow
Agents interact with external systems through tool calls. The typical flow is: the model generates a structured call request, the runtime parses the request, the corresponding operation is executed, and the result is returned to the model. The request format directly affects parsing stability and efficiency.
4.2 Common Pain Points with JSON
JSON is currently the most widespread choice—it is structurally simple and parsing libraries are mature. But in model-generation scenarios it has several notable problems:
- Strict escaping requirements: Double quotes, backslashes, and control characters inside strings must all be escaped. When models generate code, SQL, or text containing many quotes, escaping errors are common.
- Nesting errors: Mismatched brackets invalidate the entire structure, and the location of the error is hard to pinpoint.
- Inconvenient streaming parsing: A complete JSON object must be closed before it can be reliably parsed; partial content mid-stream often cannot be used directly.
4.3 Structural Advantages of XML
XML uses tags to delimit boundaries, which offers some natural advantages in these scenarios:
- Text can be embedded directly: CDATA sections preserve quotes and code verbatim, reducing the escaping burden.
- Natural nesting: Tag hierarchy is intuitive and well suited to expressing multi-layer parameters.
- Streaming-friendly: Parsers can process content incrementally as start and end tags are encountered, enabling execution while generation is still in progress.
Below are two ways to express the same tool call, for illustration only—the tool names and parameters are fictional:
<tool_call name="search_orders"><param name="user_id">10086</param><param name="query"><![CDATA[status = "shipped" AND created_at > "2026-01-01"]]></param></tool_call>
{"name":"search_orders","arguments":{"user_id":"10086","query":"status = \"shipped\" AND created_at > \"2026-01-01\""}}
The comparison shows that quotes in the query must be escaped one by one in JSON, whereas content inside an XML CDATA section can be written directly.
4.4 The Costs and Security Considerations of XML
The costs of XML also need to be factored in:
- Higher token consumption: Tags themselves increase output length, which matters in metered-billing or tight-context scenarios.
- Explicit schema constraints are needed: Without constraints, the model may generate inconsistent tag structures. It is advisable to define the allowed tags, attributes, and required fields for each tool and validate them at runtime.
- Special character handling:
<,>, and&in text must be properly escaped or placed inside CDATA sections. - External entity risks: When parsing XML, external entities and external DTD loading should be disabled to prevent attacks such as XML External Entity (XXE) injection.
4.5 Selection Guidance
If tool parameters consist mainly of short strings and simple numeric values, JSON has lower overhead and a more mature ecosystem. If parameters contain substantial code, long text, or deep nesting, and streaming execution is required, XML is worth evaluating first. Whichever format you choose, parsing-failure retry and fallback strategies should be built into the runtime design rather than relying on the model to produce a correct output in one shot.
5. A Decision Framework for Engineering Adoption
When evaluating these three techniques, consider the following dimensions:
| Dimension | Full-Vocabulary Distillation | Generative Reward Model | XML Tool Calling |
|---|---|---|---|
| Main benefit | Complete preservation of distributional information | Judging and generation improve together | More stable with complex parameters, supports streaming |
| Main cost | Memory, communication, custom operators | Judging bias and reward hacking risks | Token overhead, schema maintenance |
| Prerequisites | Large-scale training clusters | Verifiable tasks or reliable external validation | Complex parameters, streaming execution required |
| Fallback on failure | Switch to sampled distillation | Fixed benchmark evaluation set | Fall back to JSON or add retries |
Before deciding, it is advisable to answer three questions: where the bottleneck of the target task lies, whether the existing infrastructure can bear the cost of the new approach, and whether there is an executable fallback path if it fails. If you can answer these three questions clearly, the technology choice will rarely stray from actual needs.
6. Summary
Full-vocabulary distillation, generative rewards, and structured tool calling correspond to three stages: training efficiency, evaluation mechanisms, and runtime interfaces. What they have in common is keeping more information intact between the model and the system, reducing lossy compression and conversion. Whether to adopt them depends on the team’s compute resources, task characteristics, and tolerance for engineering complexity.
