TLDR: The research paper introduces DICE, a lightweight framework that uses Small Language Models (SLMs) to correct and refine the outputs of Large Language Models (LLMs) to meet specific structured format requirements. LLMs often struggle with strict output formats, prioritizing reasoning over instruction adherence. DICE addresses this by having LLMs generate natural language responses first, then using trained SLMs to transform these into structured outputs. This approach significantly improves format accuracy and content correctness without fine-tuning the LLMs themselves, offering a plug-and-play solution with strong generalizability.
Large Language Models (LLMs) have made incredible strides in understanding and generating human-like text, tackling a wide array of complex tasks from creative writing to intricate problem-solving. However, a persistent challenge arises when these powerful models are asked to follow very specific instructions, especially regarding output formats like JSON or XML. While LLMs excel at reasoning, they often prioritize the core problem-solving over strict adherence to detailed formatting rules, leading to outputs that are technically correct in content but unusable due to format errors.
This issue becomes even more pronounced with larger LLMs. Counter-intuitively, as models grow in size and reasoning capability, their adherence to user-specified output formats can actually decline. This is because larger models tend to focus more on the difficulty of the problem itself, sometimes overlooking the precise structural requirements. Even a minor formatting mistake, like a misplaced bracket, can render an entire output invalid for automated systems.
Traditional solutions, such as fine-tuning LLMs on supervised datasets, come with significant drawbacks. They are computationally expensive, require extensive training time, and can lead to “catastrophic forgetting,” where the model loses some of its general knowledge or performance on other tasks. Furthermore, for many proprietary LLMs available only via API, direct fine-tuning is simply not an option.
Introducing DICE: A Collaborative Solution
To address these limitations, researchers have introduced a novel framework called DICE (guiDing SLMs to thInk with Chain-of-thought corrEction). DICE offers a lightweight and efficient approach that guides Small Language Models (SLMs) to refine the outputs of LLMs, ensuring they meet structured output specifications without altering the LLMs’ core parameters. This framework effectively decouples the reasoning process from the formatting process.
The core idea behind DICE is simple yet powerful: first, the LLM generates a natural language response, focusing purely on solving the problem without the burden of complex formatting. Then, a specially trained SLM steps in to analyze and refine this natural language output, transforming it into the desired structured format. This two-stage process preserves the LLM’s broad knowledge and reasoning abilities while guaranteeing that the final output conforms to user demands.
How DICE Works
DICE employs a two-stage training process for the SLM. It begins by constructing structured Chain-of-Thought (CoT) adaptation datasets. This involves prompting the LLM to generate natural language outputs, and then using a pre-trained SLM to generate rationales and predicted answers. A filtering process ensures that only rationales leading to correct answers are retained. For more challenging samples, the correct answer is provided as a hint to help the SLM generate better rationales. These rationales and answers are then embedded into the required structured format, creating a rich dataset for SLM training.
Following data construction, a dual-tuning strategy is applied to fine-tune the SLM. This strategy combines Supervised Fine-Tuning (SFT) with a Group Relative Policy Optimization (GRPO) algorithm. SFT helps the SLM quickly learn format specifications and an “analyze-then-answer” generation pattern. GRPO then further optimizes the SLM, focusing on the format and final answer, rather than getting overly weighted by the longer rationale segments. This ensures the SLM prioritizes critical information for structured output.
Also Read:
- CLARITY: Enhancing LLM Reasoning Quality Through Consistency-Aware Reinforcement Learning
- The Locality Dial: Bridging Interpretability and Performance in LLMs
Impressive Results and Generalizability
Experiments across various reasoning benchmarks, including mathematical, commonsense, domain-specific, and implicit reasoning tasks, have demonstrated DICE’s effectiveness. Compared to LLMs using standard in-context learning, DICE significantly improves average format accuracy by 35.4% and content correctness by 29.4%. It consistently achieves near-perfect format accuracy (approaching 100%) across all evaluated datasets, even for complex JSON and YAML formats.
One of DICE’s key strengths is its generalizability. The framework is “plug-and-play,” meaning the trained SLM can adapt various LLMs (like Qwen2.5-7B-Instruct, Meta-Llama-3-8B-Instruct, and GPT-4.1-mini) to structured tasks without needing to modify the LLMs’ parameters. It also shows strong cross-dataset generalization, maintaining high performance even when trained on one dataset and tested on another, more complex one.
Furthermore, an analysis of output consistency reveals that DICE substantially outperforms other collaborative methods by achieving higher rates of consistent correct outputs and significantly lower mis-correction rates. This indicates that DICE effectively utilizes LLM outputs without introducing unnecessary errors. While DICE does introduce a slight increase in inference latency (approximately 20%), this modest overhead is considered worthwhile given the substantial performance gains in both format and content accuracy.
In conclusion, DICE offers an efficient and adaptable solution to the challenge of structured reasoning in LLMs. By leveraging SLMs to correct and refine LLM outputs, it ensures strict adherence to user-specified formats while preserving and even enhancing the LLMs’ powerful reasoning capabilities. This innovation holds significant promise for real-world applications requiring precise and structured AI responses. You can find more details about this research paper here.


