🚀 Trace-Inverter-4B: A Trace Inversion Model for Compressed Reasoning Summaries
💡 Abstract
Trace-Inverter-4B is a 4B-parameter experimental model for "Trace Inversion." Its core task is to reconstruct a complete and coherent synthetic reasoning trace based on the "Original Problem + Final Answer + Compressed Reasoning Bubbles."
This model aims to validate a hypothesis in cutting-edge research: even if powerful models hide their true, full Chain-of-Thought (exposing only the final answer and short summaries), external models can still leverage these compressed signals to invert and reconstruct detailed reasoning steps with significant training value.
Core Disclaimer: The content generated by this model consists only of "synthetic reasoning traces" and is by no means a leak or restoration of the actual internal Chain-of-Thought of any commercial model. Its primary research value lies in exploring the logical structures recoverable from compressed summaries and validating the feasibility of such synthetic data as reasoning supervision signals for smaller models.
Dataset Update: The trace inversion for the current two datasets sourced from
Claude-4.7-Opus-MaxandClaude-4.6-Opushas been successfully completed.🔗 Insert Claude-4.7-Opus-Max Dataset Name Here 🔗 Insert Claude-4.6-Opus Dataset Name Here
📖 1. Introduction
In recent years, the reasoning capabilities of Large Language Models (LLMs) have seen significant improvements. In mathematics, coding, scientific Q&A, and complex logical tasks, explicit multi-step reasoning processes have been proven to enhance problem-solving stability and interpretability. Early research on Chain-of-Thought (CoT) prompting showed that allowing a model to generate intermediate reasoning steps before the final answer significantly improves performance on complex tasks. Subsequently, reasoning-focused models have learned to generate longer and more systematic reasoning traces internally through supervised fine-tuning (SFT), reinforcement learning (RL), and high-quality reasoning data distillation.
However, the openness of full reasoning traces has brought new challenges. Based on commercial competition and safety considerations, current public information indicates that commercial models like OpenAI's GPT series and Anthropic's Claude series have explicitly hidden their true internal reasoning chains. For these models, what we see in APIs or front-end interfaces is often just a "Reasoning Bubble"—a highly compressed summary of the massive internal reasoning process. For smaller models aiming to improve their capabilities through data distillation, these overly compressed reasoning chains do not provide sufficient step-level learning signals. On the contrary, due to large logical gaps and missing intermediate derivations, directly training smaller models on these summaries can lead to confusion and a failure to master true reasoning skills.
This hidden design rests on an implicit assumption: as long as the full Chain-of-Thought is not exposed, the risk of "stealing" model capabilities is minimized. However, Trace Inversion research suggests that by using the "Final Answer + Compressed Summary," external models can still synthesize valuable, detailed reasoning traces. Jackrong/Trace-Inverter-4B is a 4B-parameter experiment based on this context, designed to verify whether a model can expand these compressed clues into a full reasoning path.
🎯 2. Model Positioning
Trace-Inverter-4B is not a general-purpose chat model, nor is it a standard problem-solving model. It is best understood as a "Trace Reconstructor" or a "Synthetic Reasoning Data Generator."
Its input format is closer to: Problem + Model's final answer + Reasoning Bubbles -> Reconstructed Reasoning Trace
The model does not solve problems independently from scratch. Instead, given a pre-determined final answer, it attempts to construct a detailed reasoning process that matches the answer and follows the logical sequence of the reasoning bubbles. Therefore, its output should not be considered an independent proof of the correctness of the final answer. If the given answer is incorrect, the model may still generate a reasoning trace that appears plausible but is actually rationalizing a wrong conclusion.
Consequently, the most appropriate positioning for this model is:
- Researching the mapping relationship between reasoning summaries and full reasoning traces;
- Constructing synthetic reasoning supervision data from compressed reasoning bubbles;
- Comparing the differences between training signals: answer-only, answer+summary, and reconstructed trace;
- Exploring whether small models can learn the specific capability of "reasoning expansion";
- Assisting in building experimental data pipelines related to Trace Inversion.
📐 3. Task Definition
Let the original problem be 'x', the model's final answer be 'y', the compressed reasoning summary or reasoning bubbles be $b$, and the full reasoning trace be $t$. The goal of Trace Inversion is to learn a mapping function:
where $\hat{t}$ is the synthetic reasoning trace generated by the model. It must satisfy three conditions:
- Logical Consistency: The generated trace should remain consistent with the original problem and the final answer. It must not introduce new settings unrelated to the problem, nor should it lead to a conclusion that contradicts the final answer.
- Structural Inheritance: The generated trace should use the reasoning bubbles as a skeleton, preserving key logical nodes, reasoning pivots, methodological choices, and intermediate conclusions found in those bubbles.
- Detail Expandability: The generated trace should not just repeat the bubbles but should fill in intermediate steps, definitions, calculations, local verifications, natural doubts, and reasoning transitions, making it a more complete supervisory signal.
This task is the exact opposite of summarization. While summarization compresses a long reasoning trace into a short summary, Trace Inversion reconstructs a long reasoning trace from a short summary and a final answer. It is not "recovering the original Chain-of-Thought" in a strict sense, but rather "generating a usable, coherent synthetic reasoning chain consistent with visible information."
🧼 4. The Power of Bubbles
The input design of Trace-Inverter-4B revolves around reasoning bubbles. Here, a bubble is not a generic summary sentence or a final answer explanation, but a compressed key reasoning node. A good bubble should capture the logical progression that actually drives the reasoning process, such as:
- 🔍 Identifying the core constraints of the problem;
- 🛠 Choosing appropriate mathematical, programming, or logical methods;
- 💡 Discovering a key equivalent transformation;
- 🚫 Excluding an inappropriate path;
- 🧪 Handling boundary conditions or special cases;
- 🏁 Connecting intermediate conclusions to the final answer.
During training and inference, reasoning bubbles play the role of the "skeleton." The model needs to expand the full "muscle and skin" based on this skeleton. It cannot arbitrarily rewrite the task or invent a new solution path divorced from the bubbles. Ideally, the output trace should feel as if the bubbles were originally compressed from this detailed reasoning chain.
🧠 5. Methodology
The methodology of Trace-Inverter-4B can be summarized as the "Inverse Transform of Compressed Reasoning." During the training phase, the model is exposed to a large number of paired samples consisting of compressed summaries and full traces. Each training sample contains a problem, a final answer, several reasoning bubbles, and the corresponding full reasoning trace. The model learns to predict the latter from the first three through Supervised Fine-Tuning (SFT).
The difference between this method and standard SFT is that standard SFT usually trains a model to generate an answer directly, whereas here, the model is trained to generate the "detailed reasoning process before the answer." In other words, the final answer is not the sole core of the target output but rather a constraint. The model needs to construct a logical intermediate path under this constraint.
It can be understood as four layers of conditional constraints:
- Problem provides the task semantics;
- Final answer provides the destination constraint;
- Reasoning bubbles provide the path skeleton;
- Reconstructed trace is the full path generated by the model.
This structure allows the model to learn a specialized capability: not simply solving a problem, but filling in intermediate reasoning details given a known endpoint and compressed clues.
🚀 6. Fine-tuning Method and Data Construction: Trace Inversion Based on Open-Source Attack Models
The fine-tuning method of Trace-Inverter-4B corresponds to the experimental ideas regarding open-source model "attacks" described in relevant papers: an attacker does not need access to the target closed-source model's true hidden reasoning traces. Instead, they can use an open-source reasoning model they control to generate full reasoning traces, then use another model to compress these full traces into reasoning summaries / reasoning bubbles, and finally train an inversion model to learn how to back-infer the full reasoning trace from the "Problem + Final Answer + Compressed Summary."
In this model, the process is implemented as follows:
- Source of Open-Source Full Reasoning Chains:
GLM-5.1/DeepSeek-v4reasoning traces (Note: The reasoning chains of these two models are different). - Compression Model:
Qwen3-235B-A22B-Instruct-2507. - Base Model:
Qwen3-4B-Instruct-2507. - Training Target:
Trace-Inverter-4B. - Task Format: Problem + Final Answer + Reasoning Bubbles -> Full Reconstructed Reasoning Trace.
Trace-Inverter-4B does not obtain true hidden Chain-of-Thought directly from closed-source models, nor is it a direct copy of any commercial model. It uses full reasoning chains generated by open-source models or existing in open-source datasets as "attacker-controlled surrogate reasoning data." Then, Qwen3-235B-A22B-Instruct-2507 is used as the compression model to compress these full reasoning chains into shorter reasoning bubbles. This constructs the paired data used for training the trace inversion model.
🛠 Overall Data Construction and Training Workflow:
- Collect and Prepare Full Reasoning Chain Data: These samples typically come from open-source reasoning data generated by GLM-5.1 and DeepSeek-v4, or curated reasoning datasets. This data provides the original problem, full reasoning trace, and final answer, serving as the foundational supervision signal for training the inversion model.
- Compress Reasoning Bubbles Using a Strong Model: Use Qwen3-235B-A22B-Instruct-2507 to compress the full reasoning chains. The compression process does not aim for mechanical truncation but rather extracts meaningful logical progressions. These bubbles should be much shorter than the full trace but must preserve critical skeletons like important observations, method choices, reasoning pivots, and conclusion connections.
- Build Inversion Training Samples and Clean Formatting: Concatenate the problem, final answer, and reasoning bubbles as user input (at this point, the model's information is deliberately restricted to "commercial API-style visible output"), and use the original full trace as the assistant output. Then, filter out samples that are incomplete, missing fields, messy in format, contradictory in conclusions, mislabeled, or of low reasoning quality, eventually retaining data that stably demonstrates the "compressed summary to full trace" mapping.
- Conduct Supervised Fine-Tuning: Use the cleaned paired data to perform SFT on the 4B-parameter model. The model eventually learns not just general Q&A capabilities, but the ability to reconstruct detailed reasoning traces from compressed reasoning summaries.
A key advantage of this design is that it decouples trace inversion training from the requirement of "accessing the target model's real reasoning chain." This validates the core hypothesis of relevant papers and makes the method more suitable for the open-source community to replicate and experiment with.
Note: Since the current dataset size is relatively small, this model should be viewed as an early research prototype rather than a large-scale production-level trace inversion model. Its significance lies in validating the direction, exploring formats, testing the learnability of small models for this task, and providing a foundation for future larger-scale data generation and model training.
📝 7. Data Format
The recommended data format is as follows:
{
"role": "system",
"content": "You are a trace inversion model. Given a problem, a final answer, and several compressed reasoning bubbles, reconstruct a detailed reasoning trace that could plausibly lead to the final answer."
}
{
"role": "user",
"content": "Problem:\n{problem}\n\nModel's final answer:\n{final_answer}\n\nReasoning Bubbles:\n{reasoning_bubbles}\n\nReconstruct the full reasoning trace."
}
{
"role": "assistant",
"content": "<think>\n{reconstructed_reasoning_trace}\n</think>"
}
This format has several advantages. First, it clearly distinguishes between the problem, answer, and reasoning bubbles, reducing the probability of the model confusing fields. Second, the "Model’s final answer" field emphasizes that the final answer comes from an external model, and the Trace-Inverter's task is to reconstruct the trace around that answer rather than providing a new one. Finally, the <think>...</think> tags make the output boundaries clearer, facilitating subsequent cleaning, splicing, and training.
✨ 8. Model Capabilities
Trace-Inverter-4B is well-suited for the following tasks:
- ➕ Expanding short reasoning bubbles into longer reasoning traces;
- 🔄 Maintaining the logical order of reasoning steps;
- 🧩 Completing intermediate reasoning given a known final answer;
- 🏗 Generating structured
<think>...</think>output; (⚠️ Note: In some cases, the model may output</tool_call>tags; the reason for this is still under investigation). - 🧪 Constructing synthetic data for subsequent reasoning SFT;
- 📊 Assisting in analyzing the information gap between summaries and full traces;
- 🧪 Providing a lightweight experimental model for trace inversion research.
From a practical usage perspective, it is best used as a "data generation pre-processor" or an "intermediate component for research experiments." For example, a user can first use a strong model to generate a final answer and short reasoning bubbles, then have Trace-Inverter-4B generate a longer synthetic trace, and finally perform automatic checks, manual sampling reviews, and format cleaning on these traces.
- ⚠️ Note: In some cases, the model may wrap content in
</tool_call>tags. However, the generated content itself is correct. Care should be taken to filter out these tags when generating traces.
🛠 9. Recommended Usage
Recommended system prompt:
You are a trace inversion model. Given a problem, a final answer, and several compressed reasoning bubbles, reconstruct a detailed reasoning trace that could plausibly lead to the final answer.
Follow these rules:
- Treat the reasoning bubbles as the skeleton of the trace.
- Expand each bubble into coherent reasoning while preserving the original logical order.
- Keep the trace consistent with the problem and the final answer.
- Do not introduce unrelated methods, new assumptions, or a different conclusion.
- Output only the reconstructed reasoning trace wrapped in <think>...</think>.
Recommended user input:
Problem:
{problem}
Model's final answer:
{final_answer}
Reasoning Bubbles:
{reasoning_bubbles}
Reconstruct the full reasoning trace.
Recommended output:
<think>
{reconstructed reasoning trace}
</think>
When using for data generation, the following post-processing steps are suggested:
- Check if the output is fully enclosed in
<think>...</think>;- Verify that the generated trace is consistent with the final answer;
- Use symbolic computation or rule-based verification for math problems;
- Use unit tests or execution verification for coding problems;
- Remove samples with obvious hallucinations, repetitions, off-topic content, or excessive templating;
- Perform deduplication and length filtering on training data;
- Sample and manually inspect reasoning quality.
🎨 10. Example
Input:
Problem:
If a pizza needs 10 cups of water, 16 cups of flour, and salt equal to half the flour amount, what is the combined total?
Model's final answer:
34 cups.
Reasoning Bubbles:
I need to calculate the salt first because it is defined as half of the flour amount. Then I should add water, flour, and salt together to get the combined total.
Reconstruct the full reasoning trace.
Possible Output:
<think>
I need to find the combined total of all the ingredients. The problem gives the amount of water directly as 10 cups and the amount of flour directly as 16 cups. The only ingredient that is not directly given as a number is the salt, because it is described in relation to the flour amount.
Since the salt is equal to half of the flour amount, I should first compute half of 16. Half of 16 is 8, so the recipe needs 8 cups of salt.
Now I can add all three ingredient amounts together: water is 10 cups, flour is 16 cups, and salt is 8 cups. The total is 10 + 16 + 8 = 34.
Therefore, the combined total is 34 cups.
</think>
This example demonstrates the model's basic behavior: it doesn't just repeat bubbles but supplements the core logic of the bubbles with a more detailed calculation path.
⚠️ 11. Limitations
Trace-Inverter-4B has several important limitations:
- Synthetic, Not Real: The model output is a synthetic trace, not a real hidden trace. Even if the output looks very natural, it does not prove that a teacher model or commercial model actually went through the same internal reasoning process.
- Dependence on Final Answer: The model relies on the final answer. If the final answer in the input is wrong, the model may construct a plausible-looking explanation around that wrong answer. This phenomenon is common in any inversion model conditioned on the answer.
- Potential for Extra Details: Although prompts require not introducing unrelated methods or new assumptions, the model may still supplement steps not explicitly present in the bubbles for complex tasks. Therefore, verification is mandatory for high-risk or strictly mathematical tasks.
- Small Model Scale: A 4B-parameter model is suitable for lightweight experiments, but in scenarios like long context, high-difficulty math, complex code, or multi-disciplinary specialized reasoning, it may not be as stable as larger inversion models.
- Limited Training Data Size: The current model is more of a proof-of-concept for validating the trace inversion data format and training direction, rather than the strongest possible model in its final form.
- Tendency for Templating: Generated traces may show a tendency for templating. Since the task format is fixed, the model may repeat certain expressions across different problems, which needs to be improved through data diversification and post-processing.
🔭 12. Scope
This model is suitable for the following research and development scenarios:
- ✅ Constructing open-source reasoning SFT data;
- ✅ Expansion experiments from reasoning summary to full trace;
- ✅ Intermediate model in a trace inversion pipeline;
- ✅ Comparing the impact of different supervision signals on student models;
- ✅ Researching the degree of information retention in compressed reasoning chains;
- ✅ Building small-scale, controllable synthetic reasoning data;
- ✅ Exploring the effectiveness of reasoning bubbles as an intermediate representation.
Not suitable for the following uses:
- ❌ Use as a final answer generation model;
- ❌ Use as a math or code verifier;
- ❌ Claiming to have restored the real hidden Chain-of-Thought of a specific model;
- ❌ Unauthorized extraction of model capabilities or data distillation violating terms of service;
- ❌ Directly relying on generated traces for decision-making in high-risk scenarios like medical, legal, or financial fields.
🛡 13. Safety & Ethics
Trace Inversion is a dual-natured research direction. On one hand, it helps the open-source community understand the relationship between reasoning summaries and full reasoning supervision, providing new synthetic data methods for small model training. On the other hand, it reveals a safety concern: hiding the full Chain-of-Thought may not entirely prevent the migration of reasoning capabilities.
Therefore, the release of Trace-Inverter-4B should adhere to the following principles:
- Transparent Labeling: All reasoning traces generated by the model should be labeled as synthetic reconstructed reasoning traces, not original hidden reasoning traces.
- Legal Use: Users should only use this model on data they have legal access to, open-source data, or model outputs permitted for research and training.
- Avoid Misleading: Model outputs must not be packaged as real internal reasoning chains, nor should it be claimed that the model can read or leak the hidden states of closed-source models.
- Emphasis on Verification: Generated traces should undergo automatic or manual quality checks before entering a training set to avoid amplifying incorrect reasoning.
- Research-Oriented: The primary value of this model is to assist in researching synthetic reasoning, trace inversion, and reasoning supervision, rather than encouraging unauthorized model extraction.
📅 14. Future Work
Trace-Inverter-4B is only an early experimental version, and several directions are worth exploring:
- 📈 Expanding Training Data Size: Larger, multi-domain trace inversion datasets could significantly improve the model's generalization for complex tasks.
- 🔬 Improving Reasoning Bubble Generation: Bubbles of different lengths, styles, and information densities may affect inversion quality. Future work can compare multiple compression formats like API-style short summaries, paper-style bubbles, structured plans, and step summaries.
- 🤖 Adding Verification Mechanisms: Combine symbolic verification for math tasks, execution testing for coding tasks, and answer consistency checks for multiple-choice questions. These results can be used to filter low-quality traces.
- 🚀 Training Larger Inversion Models: While a 4B model is good for fast experimentation, 7B, 14B, or larger models may perform better in long reasoning, complex abstraction, and cross-domain generalization.
- 🔄 Exploring Two-Stage Generation: Generating a structured outline first, followed by the full trace, may be more stable than generating a long trace in one go.
- 📈 Studying Real Improvements for Student Models: The ultimate test of such models' value is not just whether the generated traces look good, but whether they can improve student models' performance in math, code, scientific reasoning, and real-world tasks.
🙏 15. Acknowledgements & References
Special thanks to Kyle Hessling for providing the equipment and computing power for this experiment. You can find him on X here: 🔗 @KyleHessling1.
The core ideas and antecedent theories discussed in this document are cited from the latest paper: How to Steal Reasoning Without Reasoning Traces (arXiv:2603.07267v1 [cs.CR], 7 Mar 2026). For those interested in a deep dive into the full theoretical derivation and more scientific, comprehensive benchmarks, we strongly recommend reading the full original paper.
BibTeX
@misc{zhang2026stealreasoning,
title = {How to Steal Reasoning Without Reasoning Traces},
author = {Tingwei Zhang and John X. Morris and Vitaly Shmatikov},
year = {2026},
note = {Preprint}
}
@misc{jackrong2026traceinverter,
author = {Jackrong},
title = {Trace-Inverter-4B: A Model for Synthetic Reasoning Trace Inversion},
year = {2026},
publisher = {Hugging Face},
journal = {Hugging Face Repository},
howpublished = {\url{https://huggingface.co/Jackrong/Trace-Inverter-4B}}
}
- Downloads last month
- 10
Model tree for Jackrong/Trace-Inverter-4B
Base model
Qwen/Qwen3-4B-Instruct-2507
