[KongchangAI]
· 2 min read· 1,074 words

FOPL: Reconstructing Hidden Chain-of-Thought in Reverse from Final Answers

FOPL: Reconstructing Hidden Chain-of-Thought in Reverse from Final Answers

FOPL enables model-agnostic reconstruction of hidden chain-of-thought using only inputs and final answers, useful for reasoning distillation.

This article presents Final-Output Preference Learning (FOPL), a model-agnostic method for reconstructing hidden chain-of-thought (CoT). To address the difficulty of distilling from commercial LLMs that hide their CoT, FOPL frames CoT reconstruction as a preference learning problem: using LLMs with public CoT as teachers, it collects (question, CoT, answer) triples, generates native and synthetic CoT candidates, and trains a reconstruction model via preference optimization algorithms like DPO so that, given a final answer, it prefers generating native CoT. Experiments show that FOPL captures the reasoning patterns of different LLM families and generalizes to unseen models; student models trained with reconstructed CoT match or exceed those trained with native CoT. The method lowers the barrier to distilling reasoning capabilities from black-box LLMs while raising new concerns about intellectual property and model security.

Large Language Models (LLMs) often rely on Chain-of-Thought (CoT) to reason step by step when solving complex problems, but many commercial models choose to hide their CoT traces to prevent their reasoning capabilities from being distilled. However, recent research shows that hidden CoT can be reconstructed, yet existing methods typically require training a separate attacker model for each target model, which is costly and hard to generalize. This article introduces a model-agnostic CoT reconstruction method—Final-Output Preference Learning (FOPL)—which can reconstruct the hidden reasoning process of any target LLM using only the input prompt and the visible final answer.

rss source: Learning Teacher Output Preferences from Final Responses for Reasoning Distillation

Hidden CoT and the Reconstruction Challenge

Many frontier LLMs provide final answers via API but hide their internal reasoning steps. This strategy of hiding CoT protects model intellectual property while also hindering research on transferring reasoning capabilities to small models through distillation. Prior work has shown that hidden CoT can be reconstructed by training attacker models, but these methods depend on the specific identity of the target model—i.e., training a separate reconstructor for each target LLM—which is neither economical nor flexible in practical applications.

FOPL aims for model-agnostic CoT reconstruction: given the input and final output of any target LLM, reconstruct its hidden reasoning chain without any fine-tuning on that model. This requires the reconstruction model to infer reasoning patterns from final answers and distinguish the reasoning styles of different LLMs, even if the target model never appeared during training.

The Core Mechanism of FOPL: Preference Optimization

The key innovation of FOPL is framing CoT reconstruction as a preference learning problem. For the same question and final answer, the reconstruction model must learn to prefer "native" CoT (i.e., real reasoning chains extracted from LLMs with accessible CoT) over synthetic substitutes. In this way, the reconstruction model can learn from visible final answers which reasoning patterns match specific outputs.

Specifically, the training process uses LLMs with publicly available CoT as "teachers" and collects their (question, CoT, final answer) triples. For each question, multiple candidate CoTs are generated, including native CoTs from different teachers and synthetic CoTs produced through perturbation. Then, a preference optimization algorithm (such as DPO) is used to train the reconstruction model so that, given a final answer, it is more inclined to generate native CoT. Because the training data covers a variety of reasoning patterns, the reconstruction model can generalize to unseen LLM families, identifying reasoning patterns based solely on the final output.

DPO (Direct Preference Optimization) is a preference optimization algorithm that does not require an explicit reward model. In traditional RLHF (Reinforcement Learning from Human Feedback), one typically first trains a reward model to fit human preferences, then fine-tunes the language model with reinforcement learning (such as PPO). DPO mathematically simplifies this process into a direct classification loss: given a preference pair (chosen, rejected), DPO directly optimizes the language model so that its generation probability for chosen is higher than for rejected, while implicitly constraining the model not to deviate too far from the reference model. DPO's advantages lie in stable training, computational efficiency, and the absence of sampling and reinforcement learning loops. In FOPL, DPO is used to train the reconstruction model so that, for a given final answer, it prefers generating native CoT (chosen) over synthetic CoT (rejected), thereby learning the correspondence between final outputs and reasoning patterns.

Experimental Validation and Results

The paper validates the effectiveness of FOPL through extensive experiments. On multiple reasoning benchmarks, the reconstructed CoT captures the distinctive reasoning patterns of different LLM families (including families not seen during training). More importantly, student models trained with reconstructed CoT perform comparably to or even better than student models trained with native CoT on reasoning tasks. This shows that the reconstructed CoT is not only plausible in form but also contains effective reasoning information that can be used for knowledge distillation.

The experiments also analyze the quality of the reconstructed CoT and find that FOPL can generate reasoning steps consistent with the target model's style, even if the target model's CoT has never been directly observed. This capability provides a new avenue for distilling reasoning capabilities from black-box LLMs, while also raising new considerations regarding model privacy and security.

Reasoning Distillation refers to the process of transferring the reasoning capabilities of a large teacher model to a smaller student model. A typical approach is to use the reasoning chains (CoT) generated by the teacher model as supervision signals, training the student model to imitate the teacher's reasoning steps and final answers when given a question. The effectiveness of distillation depends on the quality and diversity of the teacher's CoT: high-quality CoT can guide the student model to learn the correct reasoning path, while diverse CoT helps the student model generalize. However, when the teacher model's CoT is hidden, distillation cannot proceed directly—which is exactly the problem FOPL attempts to solve: by reconstructing the hidden CoT, it provides usable reasoning supervision signals for distillation. In the experiments, student models are trained with reconstructed CoT and compared with student models trained with native CoT to verify whether the reconstructed CoT retains sufficient reasoning information.

Implications for Reasoning Distillation and Security

The emergence of FOPL has dual significance for the field of reasoning distillation. On the positive side, it lowers the barrier to extracting reasoning capabilities from powerful but closed LLMs, helping to advance the reasoning capabilities of small models, especially in resource-constrained scenarios. On the negative side, it could also be used to bypass model providers' protections for hidden CoT, raising concerns about intellectual property and security.

From a technical perspective, FOPL demonstrates the potential of preference learning for reverse-engineering reasoning patterns. In the future, similar methods could be used to analyze a model's reasoning style and even detect plagiarism or distillation behavior between models. At the same time, model providers may need to consider new protective measures, such as perturbing or adding noise to final outputs, to increase the difficulty of reconstruction.

Conclusion

FOPL proposes a model-agnostic method for reconstructing hidden CoT, learning reasoning patterns from final answers through preference optimization without requiring target-specific training for the target LLM. Experiments demonstrate that the reconstructed CoT can be effectively used for reasoning distillation and generalizes to unseen model families. This work advances the development of reasoning distillation technology while also reminding us to pay attention to the balance between model transparency and security.

#FOPL#chain-of-thought reconstruction#reasoning distillation#preference optimization#DPO#LLM security
Share:

Related articles