CB-Agent: Concept-Based In-Context Learning for Sequential Action Selection
Organizations: Tsinghua Shenzhen International Graduate School, Tsinghua University, Shenzhen, China
Abstract
In-context learning (ICL) allows large language models to use demonstrations without updating their parameters. For interactive agents, demonstrations are trajectories of reasoning, actions, and observations that illustrate how to complete a task. Reusing demonstrations in new situations is challenging: directly inputting full trajectories consumes limited prompt space and constrains the overall effectiveness, while natural-language summaries require the agent to translate general guidance into specific action choices. Therefore, we study whether expert action choices can directly supervise a reusable scoring rule. We propose CB-Agent, which extends concept-based ICL to sequential action selection. We extract environment-action decisions from expert trajectories and fit a concept vector by maximum likelihood to model the conditional distribution over candidate actions given the context. This model combines the concept with frozen language-model features and priors. During ReAct interaction, the agent uses this distribution to select environment actions without including demonstrations in the action-scoring context. Across TextWorld, ALFWorld, and ScienceWorld, CB-Agent achieves the highest cross-benchmark average among the evaluated methods at all three tested model sizes and ranks first on TextWorld and ScienceWorld at each size. ALFWorld experiments support the learned concept's contribution beyond prior-only scoring and show further gains when combined with Reflexion. Code is available at https://anonymous.4open.science/r/CB-Agent-DFF9/.
Figures & tables
| Fixed action space | Open action space | ||||
|---|---|---|---|---|---|
| Model | Method | TextWorld | ALFWorld | ScienceWorld | Avg. |
| Qwen3-4B | ReAct | 61.8 | 76.9 | 53.9 | 64.2 |
| Act-only | 52.0 | 54.5 | 48.6 | 51.7 | |
| Self-Consistency | 57.4 | 69.4 | 35.4 | 54.1 | |
| StateAct | 43.3 | 79.1 | 28.7 | 50.4 | |
| ExpeL | 37.0 | 67.2 | 58.7 | 54.3 | |
Appendix figures & tables1 asset
Supplementary material from the paper’s appendix.
Appendix
| Symbol | Meaning |
|---|---|
| Prediction and interaction | |
| , , | Input text, candidate label, and finite nonempty label set in CB-ICL. |
| Positive base weight for label in the CB-ICL model. | |
| Task instruction specifying the goal of an interaction. | |
| , | Complete interaction trajectory and its number of steps, including both environment and Think actions. |
| , , | Interaction-step index, environment or Think action, and recorded feedback. |
LLM Agents
Large language model agents use language models to plan, use tools, and act across multi-step tasks and environments.
See all 681 papers