Skip to content

DanlingMeng/HippoSpark

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

16 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

HippoSpark

Official anonymous implementation of the paper:

HIPPOSPARK: An On-Demand Experience System for LLM Reasoning

HIPPOSPARK is a state-level experience system for complex LLM reasoning.

Unlike existing task-level experience methods that retrieve generic past trajectories or global summaries, HIPPOSPARK performs on-demand experience retrieval at reasoning bottlenecks, providing targeted guidance for the current reasoning state.

The framework introduces a transition-centric reasoning paradigm where experience is used only when the next reasoning move becomes uncertain.


Method Overview

HIPPOSPARK consists of two tightly coupled components:

  • On-demand Experience Utilization (OEU)
    Dynamically determines when retrieval is necessary during reasoning and generates experience-guided next moves.

  • Bottleneck-focused Experience Construction (BEC)
    Distills historical trajectories into reusable state-level experience units centered around pivotal reasoning transitions.

Instead of directly inserting retrieved trajectories into the full reasoning context, HIPPOSPARK converts retrieved experience into actionable local guidance for the current bottleneck state.


Key Features

  • State-level experience retrieval

    • Retrieval is triggered by local reasoning bottlenecks rather than global task similarity.
  • On-demand memory usage

    • Experience is invoked only when the next move is unclear.
  • Transition-centric reasoning

    • Retrieved experience guides only the immediate next move instead of conditioning the entire trajectory.
  • Dual-layer experience design

    • Each experience unit contains:
      • decision-level strategy cues
      • execution-level supporting knowledge
  • Cross-domain reasoning support

    • Supports:
      • mathematical reasoning
      • scientific reasoning
      • code reasoning

Benchmarks

HIPPOSPARK is evaluated on:

  • AIME24
  • AIME25
  • GPQA-Diamond
  • BigCodeBench-Hard

across multiple backbone models including:

  • Qwen3-14B
  • Qwen3-32B
  • GPT-5.4-mini

Anonymous Release

This repository is released anonymously for the NeurIPS 2026 review process.

The repository includes:

  • source code
  • prompts
  • experiment scripts
  • released outputs
  • reproduction utilities

Additional cleanup and documentation will be added after the review process.


Repository Structure

HippoSpark/
├── Code/                         # Code reasoning pipeline
├── Math/                         # Math reasoning pipeline
├── Science/                      # Science reasoning pipeline
├── results/                      # Experimental outputs and evaluation logs
├── assets/                       # README figures
├── requirements.txt
└── README.md

Math

  • Experience_Construction.py

    • Construct math experience graphs from reasoning trajectories.
  • ExpUtilization.py

    • Retrieve and utilize experience during mathematical reasoning.

Science

  • get_exp.py

    • Construct science experience graphs.
  • gpqa_dimond_utilize/

    • Modular GPQA utilization framework including:

      • agent loop
      • extraction
      • experience graph store
      • verifier
      • calculation tools

Code

  • get_exp.py

    • Construct coding experience graphs.
  • exp_utilization.py

    • Experience-guided coding-task solving and verification.

Experimental Results

We release experiment outputs and evaluation logs in:

results/
├── aime24/
├── aime25/
├── gpqa_diamond/
└── bigcodebench/

The released results may include:

  • model generations
  • reasoning trajectories
  • retrieved experiences
  • verifier outputs
  • evaluation statistics

These files are provided for transparency and reproducibility.


Setup

Create the environment and install dependencies:

python -m venv .venv
source .venv/bin/activate
pip install -r requirements.txt

Configure model and API settings before running:

export API_BASE_URL=http://127.0.0.1:8000/v1
export VLLM_API_BASE=http://127.0.0.1:8000/v1
export API_KEY=EMPTY
export VLLM_API_KEY=EMPTY
export MODEL_NAME=Qwen3-32B
export EMBEDDING_MODEL_PATH=BAAI/bge-large-en-v1.5

For remote OpenAI-compatible endpoints, replace the API base URLs and keys with your own configuration.

Do not commit private API keys.


Reproduction

Typical workflow:

  1. Construct an experience graph.
  2. Run the corresponding utilization pipeline.
  3. Evaluate generated outputs.

Example:

python Math/ExpUtilization.py \
  --input data/aime_2024.jsonl \
  --output outputs/aime2024_results.jsonl \
  --pkl outputs/math_memory_graph.pkl \
  --device cuda:0

Experience Construction

HIPPOSPARK constructs reusable experience from historical trajectories through:

  1. Bottleneck transition analysis
  2. Supporting knowledge consolidation
  3. Experience card synthesis
  4. Graph-based integration and deduplication

Each experience card contains:

  • a situation-goal anchor
  • a strategic decision cue
  • linked execution-level support knowledge

On-Demand Experience Utilization

At inference time, HIPPOSPARK:

  1. Assesses the current reasoning state
  2. Determines whether the next move is uncertain
  3. Retrieves relevant state-level experience
  4. Generates an experience-guided next move
  5. Verifies the move before commitment

Experience is used only locally for the current transition and is not permanently injected into the reasoning trajectory.


Notes

  • Local absolute paths and private API keys have been removed.
  • Dataset paths should be configured through CLI arguments or environment variables.
  • Experience graphs are stored as .pkl files.
  • Outputs are typically stored as JSONL files.

Citation

Anonymous during review.

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

No releases published

Packages

 
 
 

Contributors