Papers
Topics
Authors
Recent
Search
2000 character limit reached

CogER-Agent: Elastic Reasoning for LLMs

Updated 18 December 2025
  • CogER-Agent is a cognitive-inspired reinforcement learning agent that models hierarchical human reasoning as a finite-horizon MDP and adapts its strategy based on query complexity.
  • It employs Group Relative Policy Optimization and LoRA adaptation to fine-tune its policy, achieving significant accuracy and efficiency gains over traditional scaling methods.
  • The agent integrates tool-assisted reasoning by invoking external resources as needed, demonstrating superior performance across diverse benchmarks in both in-domain and out-of-domain tasks.

CogER-Agent is a cognitive-inspired reinforcement learning agent designed for elastic reasoning in LLMs. Developed within the CogER (Cognitive-Inspired Elastic Reasoning) framework, the agent autonomously selects among multiple reasoning strategies per query, adapting computational effort according to task complexity. CogER-Agent models hierarchical human reasoning as a Markov Decision Process (MDP) and is trained with a Group Relative Policy Optimization (GRPO) algorithm. It supports tool-assisted reasoning, allowing the LLM to invoke external resources as necessary, and demonstrates significant efficiency and accuracy gains over prior scaling and routing methods (Hu et al., 17 Dec 2025).

1. Markov Decision Process Formulation

CogER-Agent's reasoning strategy selection is formalized as a finite-horizon MDP, (S,A,T,R,π)(\mathcal{S}, \mathcal{A}, \mathcal{T}, \mathcal{R}, \pi). The state at time tt is st=[x,y1:t−1,Li]s_t = [x, y_{1:t-1}, L_i], where xx is the user query, y1:t−1y_{1:t-1} the partial chain-of-thought (CoT), and LiL_i the inferred complexity level (Li∈{L1,L2,L3,L4}L_i \in \{L_1, L_2, L_3, L_4\}). Each state either contains an explicit complexity tag or maintains the information within the model's hidden state.

The action space A\mathcal{A} comprises four discrete high-level modes:

  • No_Think\mathrm{No\_Think}: Immediate answer (level-1, rapid inference)
  • Think\mathrm{Think}: Intermediate reasoning (e.g., invoking a larger LLM)
  • tt0: Escalated chain-of-thought
  • tt1: External tool invocation

and the vocabulary tt2 for standard token emission, so tt3.

The transition function tt4 deterministically updates the state, either by appending a mode-selection tag or emitting a token.

The reward function is a terminal scalar combining format validation, output correctness, and penalization for unnecessary cognitive escalation:

tt5

tt6 enforces well-formed tags, tt7 rewards correct answers, and tt8 is defined as tt9 with st=[x,y1:t−1,Li]s_t = [x, y_{1:t-1}, L_i]0 and st=[x,y1:t−1,Li]s_t = [x, y_{1:t-1}, L_i]1 to encourage minimal sufficient reasoning.

2. Policy Parameterization and Group Relative Policy Optimization

The policy st=[x,y1:t−1,Li]s_t = [x, y_{1:t-1}, L_i]2 is a single-headed softmax over joint actions:

st=[x,y1:t−1,Li]s_t = [x, y_{1:t-1}, L_i]3

where st=[x,y1:t−1,Li]s_t = [x, y_{1:t-1}, L_i]4 outputs unnormalized logits.

CogER-Agent is optimized using Group Relative Policy Optimization (GRPO), a PPO-style algorithm with KL regularization. For each group of st=[x,y1:t−1,Li]s_t = [x, y_{1:t-1}, L_i]5 rollouts st=[x,y1:t−1,Li]s_t = [x, y_{1:t-1}, L_i]6 under the old policy st=[x,y1:t−1,Li]s_t = [x, y_{1:t-1}, L_i]7, rewards st=[x,y1:t−1,Li]s_t = [x, y_{1:t-1}, L_i]8 are computed and normalized as st=[x,y1:t−1,Li]s_t = [x, y_{1:t-1}, L_i]9, giving relative advantage xx0 to each token in xx1. The GRPO objective is:

xx2

where xx3 is the PPO clipping threshold, xx4 the KL penalty, and xx5 a small reference policy.

3. Training Procedure

Query difficulty is estimated in situ by the 7B-parameter CogER-Agent using a prompt requiring level assignment (xx6–xx7) prior to answer generation. For xx8, a direct answer is also output. For each query, xx9 complete trajectories (rollouts) are sampled, collectively labeled with the terminal reward as in equations (1)–(4) and normalized within-group to yield the advantage.

Fine-tuning employs GRPO combined with LoRA adaptation (rank y1:t−1y_{1:t-1}0), using AdamW (y1:t−1y_{1:t-1}1 learning rate), batch size y1:t−1y_{1:t-1}2, and a maximum generation of y1:t−1y_{1:t-1}3 tokens. Training is performed over a single epoch using an 8,000-query mixture (2,000 each from GSM8K, MATH, CommonsenseQA, MedQA), with three random seeds (y1:t−1y_{1:t-1}4) and mean ± standard deviation reported over three runs.

4. Cognitive Tool-Assisted Reasoning (CoTool)

For level-4 (Delegate) queries, CogER-Agent invokes a tool-augmented reasoning mechanism ("CoTool"). The agent alternates between internal generation and external tool invocation:

  • Generation proceeds until the LLM emits EOS or a tool query boundary token.
  • On emission of <|end_tool_query|>, the sub-query y1:t−1y_{1:t-1}5 is extracted.
  • A dedicated tool selector, prompted with task-specific instructions, chooses the optimal RSTKit tool and JSON arguments, executes the tool, and returns the output.
  • The tool's result is appended to the CoT (as <|begin_tool_result|>...</|end_tool_result|>), resuming internal reasoning.
  • The process is iterated up to a maximum number of tool calls/turns.

Formally, the probability of an y1:t−1y_{1:t-1}6-th tool query is given by:

y1:t−1y_{1:t-1}7

where y1:t−1y_{1:t-1}8 is the instruction, y1:t−1y_{1:t-1}9 the previous reasoning, and LiL_i0 the last tool output.

5. Empirical Evaluation and Ablation

CogER-Agent has been evaluated against contemporary test-time scaling and routing baselines across in-domain (ID; e.g., GSM8K, MATH, CommonsenseQA, MedQA) and out-of-domain (OOD; MAWPS, CollegeMath) tasks. Performance is measured by exact match (EM), parameter usage, latency, and tokens generated.

Main Results

Baseline AVG-ID EM AVG-OOD EM
DeepSeek-R1 81.55 83.00
S1-32B 78.80 81.32
ReasonFlux-32B 68.51 86.25
CogER-Agent 89.28 93.56

CogER-Agent improves ID EM by +9.5% over DeepSeek-R1 and OOD EM by +12.8%.

Ablation by Reasoning Mode

Mode ID EM OOD EM
LiL_i1 (7B) 76.28 86.23
LiL_i2 (32B) 83.62 89.49
LiL_i3 (QWQ) 86.75 93.13
LiL_i4 (CoTool) 88.42 92.89
CogER (all) 89.28 93.56

Reward Component Ablation

Version ID EM OOD EM
Training-free prompt 86.35 92.78
w/o LiL_i5 87.37 93.42
w/o LiL_i6 87.89 92.21
CogER full 89.28 93.56

Eliminating format or hierarchy terms reduces performance and promotes excessive LiL_i7 delegation.

Impact of CoTool (Math Benchmarks)

Version MATH-500 EM Tool-Invoc. Rate CollegeMath EM Rate
w/o CoTool 87.20 – 87.93 –
+ CoTool 97.00 3.03% 89.04 5.17%

A 10% absolute gain in MATH-500 EM is achieved with only 3% tool invocations.

Efficiency Metrics

Method Parameters Latency (s) Tokens/query
DeepSeek-R1 671B 506.19 654.63
S1-32B 32B 273.47 946.70
ReasonFlux-32B 32B 286.97 1050.63
CogER-Agent 29.6B 118.53 489.71

CogER-Agent exhibits over 4LiL_i8 speedup compared to DeepSeek-R1, with reduced token usage.

Routing Strategy Comparison

Strategy ID EM OOD EM
Uniform random 84.21 90.28
Supervised router 84.09 90.32
CogER-RL 89.28 93.56

RL-based MDP training advanstages over naïve or purely supervised routing approaches.

6. Significance and Implications

CogER-Agent delivers hierarchical reasoning by integrating per-query dynamic strategy selection, explicit reward signals for correctness and efficiency, and automated tool invocation. The MDP-based GRPO policy robustly adapts to workload variability, realizing both computational savings and substantial accuracy improvements across diverse benchmarks. The inclusion of Cognitive Tool-Assisted Reasoning grants the agent the capacity to handle previously intractable queries with minimal external resource usage. This suggests a promising research trajectory for LLM frameworks capable of fine-grained task allocation, hierarchical control, and selective tool use, with direct evidence that reinforcement learning formulation and hybrid reward functions are superior to static or supervised-only alternatives in the context of elastic reasoning for LLMs (Hu et al., 17 Dec 2025).

Definition Search Book Streamline Icon: https://streamlinehq.com
References (1)

Topic to Video (Beta)

No one has generated a video about this topic yet.

Whiteboard

No one has generated a whiteboard explanation for this topic yet.

Follow Topic

Get notified by email when new papers are published related to CogER-Agent.