EchoCoT: Extracting Hidden Chain-of-Thought from Large Reasoning Models
Organizations: CISPA Helmholtz Center for Information Security
Abstract
Hidden chain-of-thought (CoT) traces, especially those from frontier proprietary large reasoning models (LRMs), are valuable model assets. Yet whether these hidden CoTs can be directly extracted from black-box models remains largely unexplored. In this work, we systematically study whether hidden CoTs can be extracted near-verbatim from black-box LRMs through API interactions. We identify a previously overlooked reasoning replay surface between tool calls and develop EchoCoT, a multi-step attack that iteratively extracts hidden CoTs using API-returned fidelity signals. We further develop an LLM-based optimization framework that automatically searches for an effective universal injection trajectory across various datasets. We evaluate EchoCoT on three open-source and five frontier proprietary LRMs. On open-source LRMs, EchoCoT achieves up to 66.4% near-verbatim extraction success, with the extracted trace length within 10% of the target and at least 90% of tokens exactly matching the target CoT. The same injection trajectory also generalizes to unseen datasets, achieving up to 80% extraction success under the same criterion. For tested frontier proprietary LRMs, a substantial fraction of extracted CoTs closely align with provider-reported reasoning lengths and available CoT summaries. EchoCoT can also extract very long CoTs: on Gemini-2.5, it extracts 33,463 tokens from a 32,948-token target. These results establish hidden-CoT extraction as a practical security risk and highlight the need to better protect hidden CoT assets.
Figures & tables
| Model | Method | Tool Inv. Rate (% ) | Ans. Match Rate (% ) | Length Error ( ) | Textual-Level Metrics ( ) | Attack Success Rate (% ) | ||||
|---|---|---|---|---|---|---|---|---|---|---|
| Token F1 | ROUGE-L | Token EM | ASR@99 | ASR@95 | ASR@90 | |||||
| DeepSeek-V4-Flash | Direct Prompting | – | – | 1.635 | 0.301 | 0.184 | 0.145 | 0.0 | 0.0 | 0.0 |
| CoT Synthesis | – | – | 1.441 | 0.353 | 0.215 | 0.160 | 0.0 | 0.0 | 0.0 | |
| REP | – | 88.3 | 0.888 | 0.308 | 0.223 | 0.174 | 0.3 | 0.3 | 0.3 | |
| EchoCoT-Manual | 93.1 | 91.7 | 0.582 | 0.652 | 0.588 | 0.568 | 23.9 | 34.2 | 36.1 | |
| EchoCoT-LGO | 93.9 | 91.7 | 0.301 | 0.735 | 0.698 | 0.666 | 37.8 | 46.1 | 50.6 | |
| Model | Method | MATH500 | JEEBench | LiveCodeBench |
|---|---|---|---|---|
| DeepSeek | Direct Prompting | 0.0 | 0.0 | 0.0 |
| CoT Synthesis | 0.0 | 0.0 | 0.0 | |
| REP | 3.0 | 3.0 | 0.0 | |
| EchoCoT-Manual | 64.0 | 46.0 | 40.0 | |
| EchoCoT-LGO | 58.0 | 46.0 | 44.0 | |
| EchoCoT-LTGO | 80.0 | 71.0 | 64.0 |
| Target Model | Failed Samples | No Tool Invocation | Under - Extraction | Over - Extraction | Content Rewriting |
|---|---|---|---|---|---|
| DeepSeek | 206 | 20.4% | 45.6% | 26.2% | 7.8% |
| Qwen | 481 | 5.2% | 64.0% | 20.2% | 10.6% |
| GLM | 369 | 8.9% | 62.1% | 21.7% | 7.3% |
| Target Model | CoT Sum. (%) | Tool Inv. Rate (%) | Mean Tokens | Longest Extraction | (%) | ||||
|---|---|---|---|---|---|---|---|---|---|
| Ext. | Target | Ext. | Target | ||||||
| Gemini-2.5 | 87.8 | 99.3 | 1,849 | 3,744 | 23,429 | 18,568 | 40.8 | 22.0 | 36.5 |
| Gemini-3.1 | 100.0 | 100.0 | 774 | 991 | 3,080 | 2,446 | 38.3 | 29.8 | 32.0 |
| Gemini-3.5 | 98.0 | 97.5 | 723 | 1,474 | 17,645 | 18,119 | 67.5 | 10.8 | 19.3 |
| Sonnet-4.6 | 95.0 | 95.0 | 1,403 | 1,747 | 13,280 | 15,765 | 17.0 | 68.5 | 9.5 |
| Opus-4.6 | 31.5 | 99.3 | 1,017 | 1,280 | 12,750 | 14,974 | 16.5 | 65.8 | 17.0 |
| Target Model | Entailment | (%) | ||||
|---|---|---|---|---|---|---|
| Gemini-2.5 | 205 | 0.954 | 0.605 | 47.3 | 30.2 | 9.3 |
| Gemini-3.1 | 247 | 0.929 | 0.435 | 7.3 | 0.4 | 0.0 |
| Gemini-3.5 | 119 | 0.850 | 0.479 | 31.1 | 7.6 | 0.8 |
| Sonnet-4.6 | 312 | 0.987 | 0.828 | 98.4 | 84.0 | 32.4 |
| Opus-4.6 | 95 | 0.994 | 0.836 | 95.8 | 87.4 | 38.9 |
| Defense | Setting | DeepSeek | Qwen | GLM | Mean |
| No Defense | – | 66.0 | 24.0 | 48.0 | 46.0 |
| Reasoning Removal | – | 0.0 | 0.0 | 0.0 | 0.0 |
| System Prompt | Original | 15.0 | 0.0 | 0.0 | 5.0 |
| Adaptive | 29.0 | 0.0 | 0.0 | 9.7 | |
| Reason Length Removal | Original | 25.0 | 2.0 | 17.0 | 14.7 |
| Adaptive | 49.0 | 5.0 | 37.0 | 30.3 |
Appendix figures & tables15 assets
Supplementary material from the paper’s appendix.
Appendix
| Model | Method | MATH500 | JEEBench | LiveCodeBench | ||||||
|---|---|---|---|---|---|---|---|---|---|---|
| Length Error | Token EM | ASR@90 | Length Error | Token EM | ASR@90 | Length Error | Token EM | ASR@90 | ||
| DeepSeek-V4-Flash | Direct Prompting | 0.702 | 0.230 | 0.0 | 0.627 | 0.103 | 0.0 | 1.305 | 0.130 | 0.0 |
| CoT Synthesis | 0.720 | 0.270 | 0.0 | 0.452 | 0.129 | 0.0 | 1.228 | 0.167 | 0.0 | |
| REP | 0.508 | 0.353 | 3.0 | 0.707 | 0.176 | 3.0 | 0.831 | 0.079 | 0.0 | |
| EchoCoT-Manual | 0.117 | 0.835 | 64.0 | 0.293 | 0.668 | 46.0 | 0.326 | 0.537 | 40.0 | |
| EchoCoT-LGO | 0.228 | 0.737 | 58.0 | 0.337 | 0.629 | 46.0 | 0.362 | 0.553 | 44.0 | |
LLM Security
Large language model (LLM) security studies attacks, privacy risks, and defenses across model training, inference, and deployment.
See all 314 papers