Reinforcement Learning Improves Traversal of Hierarchical Knowledge in LLMs

Renfei Zhang, Manasa Kaniselvan, Niloofar Mireshghallah · Submission to ICLR 2026 · Withdrawn

TL;DR

Reinforcement learning (RL)-enhanced reasoning models consistently outperform base models on pure memorization tasks like medical and patent code lookups by over 20 percentage points. This paper reveals that RL does not inject new factual knowledge, but instead teaches models how to systematically navigate hierarchical knowledge structures already stored in their weights. Remarkably, guiding base models with structured hierarchical prompts recovers up to 70% of these gains without any RL training.

What Problem Does This Paper Address?

Conventional wisdom suggests that RL fine-tuning improves multi-step logical reasoning at the expense of raw memorization and factual recall—a phenomenon often termed the "alignment tax."

However, recent reasoning models (such as DeepSeek-R1, QwQ-32B, and Magistral) substantially outperform non-reasoning base models on benchmarks requiring pure memorization and code lookups (e.g., finding the condition corresponding to ICD-9 code 57.95). If RL optimizes for reasoning rather than memorization, why do reasoning models excel at retrieval-heavy tasks? The authors investigate the mechanism behind this paradox: does RL create new knowledge, enhance logical deduction, or simply improve how models traverse pre-existing parametric knowledge hierarchies?

Methods

To isolate how models access structured knowledge, the authors compare standard base, instruction-tuned, reasoning-enhanced, and distilled models using controlled prompt templates and task complexity levels:

  • Structured Prompting Framework: Models are evaluated under multiple zero-shot configurations:
  • Template 1 (Baseline Answer Only): Direct multiple-choice answer with no intermediate steps.
  • Template 2 (Chain-of-Thought): Standard answer-plus-explanation prompting.
  • Template 3 (Structured Hierarchical Navigation): Explicitly instructs the model to break down the concept hierarchically, evaluate each candidate option systematically, and eliminate incorrect choices.
  • Template 4 (Open-Ended Diagnostic): Asks for code decoding without providing candidate options.
  • Hierarchical Alignment Score (HAS): A novel metric evaluating the quality of predicted hierarchical paths in patent classifications. It takes the harmonic mean of:
  • Alignment F1-Score ($AF_1$): Precision and recall over identified hierarchical ancestor sets.
  • Common Subsequence Score (CSS): Longest Common Subsequence of ancestors divided by ground truth path length, measuring structural preservation.

$$\text{HAS} = \frac{2 \times AF_1 \times \text{CSS}}{AF_1 + \text{CSS}}$$

Datasets

  • MedConceptsQA: A multiple-choice medical concept retrieval benchmark covering over 800,000 biomedical concepts across hierarchical taxonomies including ICD-9, ICD-10, CPT, and ATC.
  • International Patent Classification (IPC): Queries mapped to hierarchical patent codes, stratified into:
  • Memory-Light (ML, 0–2 retrievals): Parent/grandparent lookups and level decoding.
  • Memory-Moderate (MM, 3–4 retrievals): Great-grandparent lookups and path reconstructions.
  • Memory-Heavy (MH, 5+ retrievals): Cousin relationships, deepest descent, orphan detection, and complex common ancestor tracing.
  • MMLU (Prehistory subset): Multiple-choice questions assessing purely factual historical recall without hierarchical taxonomy.

Key Insights and Ideas

  • Procedural Traversal over Direct Recall: When multiple-choice options are withheld (Template 4), reasoning models fail just like base models. They do not hold superior raw factual recall; rather, RL instills a search procedure—systematically unpacking taxonomy levels and eliminating distractors.
  • Prompting Can Substitute for RL: Instructing a base model to perform explicit hierarchical breakdown and stepwise elimination (Template 3) closes up to 70% of the performance gap, proving the knowledge was always present in the base model.
  • Distillation Degrades Navigation: Distilled reasoning models (e.g., R1-Distill-Qwen-32B) fail to inherit the teacher’s traversal skills. They lag behind true reasoning models and well-prompted base models, suggesting direct distillation can harm access to existing parametric knowledge.
  • Specialization Hurting Structure: Math-specialized models (e.g., Qwen2.5-Math-7B) scored lower than general base models on retrieval tasks (20.9% vs. 27.6%), indicating narrow fine-tuning may disrupt general knowledge navigation.

Key Results

  • Closing the Gap via Prompting: On MedConceptsQA, DeepSeek-R1 initially led DeepSeek-V3 by 23.7 percentage points under baseline prompting (77.8% vs. 54.1%). Structured prompting boosted DeepSeek-V3 to 69.8% (71.7% majority vote), shrinking the gap to 6.1–7.5 pp.
  • Base Models Beating Tuned Variants: On IPC codes, structured prompting increased Qwen2.5-32B accuracy from 64.4% to 77.7%, surpassing its instruction-tuned variant (77.4%). DeepSeek-V3 gained 15 pp on IPC codes under Template 3.
  • High-Complexity Scaling: On Memory-Heavy IPC tasks (5+ retrievals), QwQ-32B achieved 67.1% accuracy and a 0.430 HAS score compared to Qwen2.5-32B's 55.6% accuracy and 0.405 HAS. DeepSeek-R1 maintained a superior HAS of 0.597 over DeepSeek-V3's 0.503.
  • Distillation Underperformance: R1-Distill-Qwen-32B scored 37.5% on MedConceptsQA (T1), severely trailing both DeepSeek-R1 (77.8%) and QwQ-32B (48.2%), and trailing base Qwen2.5-32B prompted with Template 3 (40.4%).

Limitations and Future Work

  • Opaque RL Recipes: Because exact training data and RL algorithms for proprietary and open-weights models are not fully disclosed, findings describe empirical behaviors rather than isolated algorithmic variables.
  • Domain Scope: Evaluations centered on formalized, tree-like coding systems (medical and patent classifications). Evaluating how this applies to amorphous, weakly structured factual knowledge remains open.
  • Unassisted Recall: Neither RL nor structured prompting resolves failures on open-ended generation without candidate options, indicating that unassisted factual generation remains a fundamental challenge.

Summary updated

Abstract

Reinforcement learning (RL) is often credited with improving language-model reasoning and generalization, possibly at the expense of memorized knowledge degradation. We observe, however, that on certain tasks designed to test pure knowledge recall; e.g., "Which disease corresponds to ICD-9 code 57.95?", RL-enhanced reasoning models (DeepSeek-R1, QwQ, Magistral) still consistently surpass their non-reasoning counterparts (DeepSeek-V3, Qwen-Instruct, Mistral-Small) by a large margin of 21 percentage points. Our analysis indicates that these gains stem not from acquisition of new knowledge during RL, but from improved access to knowledge already encoded during pretraining: RL appears to teach models to efficiently traverse hierarchical structure in the data to recall relevant information at inference time. To test this hypothesis we demonstrate that structured prompting designed to explicitly instruct for similar step-by-step hierarchy traversal recovers most of the RL gains, reducing the 21pp gap to 6.1pp on MedConceptsQA, without any RL training. Taken together, these results suggest that many benefits attributed to ``reasoning training'' may, in fact, arise from enhanced knowledge navigation rather than improved logical capability.
BibTeX
@inproceedings{zhang2025reinforcement,
  author = {Renfei Zhang and Manasa Kaniselvan and Niloofar Mireshghallah},
  title = {{Reinforcement Learning Improves Traversal of Hierarchical Knowledge in LLMs}},
  booktitle = {FoRLM @ NeurIPS},
  year = {2025},
  url = {https://openreview.net/forum?id=jVh8Rhnjm1},
}
Figure