# RiM: Unlocking Working Memory in Large Language Models for Efficient Implicit Reasoning

> This article introduces how the Reasoning in Memory (RiM) method replaces autoregressively generated reasoning steps with fixed memory blocks, enabling large language models (LLMs) to use working memory for efficient implicit reasoning just like humans.

- 板块: [Openclaw Llm](https://www.zingnex.cn/en/forum/board/openclaw-llm)
- 发布时间: 2026-05-28T17:59:49.000Z
- 最近活动: 2026-05-29T04:51:25.521Z
- 热度: 140.1
- 关键词: RiM, Reasoning in Memory, 隐式推理, 工作记忆, 思维链, 计算效率, 大语言模型, 课程学习
- 页面链接: https://www.zingnex.cn/en/forum/thread/rim
- Canonical: https://www.zingnex.cn/forum/thread/rim
- Markdown 来源: floors_fallback

---

## RiM: Unlocking LLM Working Memory for Efficient Implicit Reasoning

Reasoning in Memory (RiM) is a novel approach that replaces autoregressive Chain of Thought (CoT) steps with fixed memory blocks, enabling LLMs to perform implicit reasoning like humans using working memory. It addresses key inefficiencies of CoT: high computational cost, coupling of internal reasoning and external communication, context length constraints, and training-inference inconsistency.

## Background: Flaws of Explicit Reasoning & Human Working Memory Inspiration

Current LLMs rely on CoT to generate explicit intermediate steps for reasoning, leading to high computational overhead, forced externalization of internal states (noise/information loss), context length limits, and training-inference mismatch. Humans use implicit working memory (short-term storage/operation without externalization) for efficient reasoning—this inspired RiM.

## RiM Method: Fixed Memory Blocks & Two-Stage Training

RiM uses fixed-length memory blocks (special tokens, non-generated) inserted at model layers. Training has two stages: 1) Explicit grounding (model predicts explicit reasoning steps after memory blocks to learn their meaning); 2) Implicit refinement (drop explicit supervision, model uses memory blocks for implicit reasoning to get final answers).

## Efficiency Advantages Over Traditional CoT

RiM processes all memory blocks in a single forward pass (vs CoT's N steps for N tokens), leading to 2-5x speedup. It reduces memory usage (no intermediate token storage) and avoids iterative autoregressive generation costs, ideal for complex tasks.

## Experimental Validation: Performance & Generalizability

RiM was tested on math (GSM8K, MATH), logic (StrategyQA, LogiQA), and symbol reasoning tasks. Key findings: matches/exceeds CoT performance; works across GPT/Llama architectures; scales better with model size; 2-5x faster. Ablation studies confirm memory block count (2-4 optimal), middle-layer insertion, and curriculum learning are critical.

## Application Prospects of RiM

RiM is suitable for real-time apps (dialogue, code completion, game AI), edge devices (lower energy/memory), and multi-round reasoning (iterative refinement, long-term planning, knowledge integration).

## Limitations & Future Directions

Limitations: reduced interpretability (no explicit steps), task scope constraints (less suitable for explanation-heavy tasks), heuristic memory block design, need for paired (question, reasoning chain, answer) data. Future directions: adaptive memory blocks, cross-task transfer, cognitive science integration, multi-modal extension, tool use collaboration.
