togethercomputer / HybridAgent
git clone https://github.com/togethercomputer/HybridAgent.git
—
+19
stars, 24h · #764
+~133
stars, 7 days · #932
+358
stars, 30 days · #1,491
387
★ total · +59% this week
40
forks · 2 open issues
Star history (as recorded here)
LanguagePython
LicenseMIT
Created2026-10-09 (13d ago)
Last push4d ago
Watchers4
OwnerOrganization
Links
README excerpt
# Hybrid Reasoning Agents **LLM Agents that Think in latent space, Act through text** Jiaru Zou 1,2 , Yunzhe Qi 3,4 , Sirui Chen 3 , Federico Bianchi 2 , Shang Zhu 2 , Pan Lu 1 , Jingrui He 3 , James Zou 1,2 1 Stanford University · 2 Together AI · 3 UIUC · 4 Meta **HybridAgent** is an LLM agent that dynamically navigates between latent reasoning and text-based interaction within a single generation process. A lightweight **HybridLink** maps last-layer hidden states back into the input-embedding space, so the agent can enter **latent mode** for fast, inspectable inner thinking and return to **text mode** for tool calls, final answers and external monitoring. The complete hybrid context of text, latent thoughts and tool observations is carried across turns through the agent's own **working memory**, and every latent thought can be rendered as readable pseudo-text. This repository contains the method: the hybrid generation engine with Python and search tools, the **HybridSFT** and **HybridRL** post-training stages, batch inference, and the **Interpretable Latent Mode** inspector. ## ⚙️ Installation [code] ## 📁 Repository | Directory | Contents | |---|---| | `hybrid_agent/` | HybridLink, the model wrapper and loader, the hybrid generation engine (text/latent modes, working memory, concurrent tool calls) and the tools | | `hybrid_sft/` | HybridSFT: data format, objective and trainer | | `hybrid_rl/` | HybridRL: hybrid policy rollout, reward, exact rollout replay, policy update | | `hybrid_inference/` | Batch hybrid inference over a JSONL of questions | | `interpretable_latent_mode/` | Latent thoughts as pseudo-text: HTML reports and terminal view | | `scripts/` | Launchers for the three stages | ## 🤗 Released models and data Checkpoints and data load from a local directory or directly from the Hugging Face Hub. See the HybridAgent collection. | Artifact | Description | Hugging Face | |---|---|---| | HybridAgent-8B-Agentic | Qwen3-8B-Base → HybridSFT → HybridRL on agentic reasoning tasks | `togethercomputer/HybridAgent-8B-Agentic` | | HybridAgent-14B-Agentic | Qwen3-14B-Base → HybridSFT → HybridRL on agentic reasoning tasks | `togethercomputer/HybridAgent-14B-Agentic` | | HybridAgent-HybridSFT-v1 / -v2 | HybridSFT training sets: hybrid trajectories (`train.jsonl`), v1 and the upgraded v2 | `togethercomputer/HybridAgent-HybridSFT-v1`, `togethercomputer/HybridAgent-HybridSFT-v2` | | HybridAgent-HybridRL | HybridRL training sets: deep reasoning (`math.parquet`) and agentic search (`search.parquet`) | `togethercomputer/HybridAgent-HybridRL` | *Note:* Each model directory holds the backbone in Hugging Face format together with the HybridLink weights (`adapter.pt`, `adapter_config.json`). ## 🚀 Quick start ### Batch Hybrid Inference [code] One record per question: the hybrid trajectory, the extracted answer, the pseudo-text readout of every latent span and the tool-call statistics. See `hybrid_inference/`. ### Interpretable latent mode [code] Renders