arXiv:2610.32087cs.AIOct 2026

Manuscript Offprint

arXiv:2610.32087

Behaviour analysis for large language model-driven agents

Tianqiang Yan, Lizhen Qu

Abstract

Understanding language-agent behaviour requires learning how actions are organised across a trajectory and how this organisation relates to context and outcomes. We propose a general framework that connects data-driven behavioural discovery with analysis and experimental investigation. Categories developed from recorded activity define what is measured. Analyses preserve the behaviours' positions in the process and express their relationships as interpretable hypotheses. Statistical assessment and tests in held-out contexts examine the strength and scope of the evidence. Experiments, including prompt steering, then test how behaviour and outcomes change under deliberately varied conditions. A study of iterative self-reflection illustrates how discovery, dependency learning and prompt comparisons can inform one another. We develop this approach for trajectories of varying length, event order and agent roles, and identify advances in coding, analysis and experimentation needed to support its wider use.

Language agents plan, call tools, revise intermediate results and coordinate with other agents 1−4^{1-4}. These activities leave trajectories: recorded sequences of messages, actions and observations. An agent may repeat an invalid tool call after corrective feedback; a revision may retain the error identified in the preceding critique. Understanding such behaviour requires learning how actions are organised across a trajectory and how that organisation relates to outcomes. This aim belongs to the broader study of machine behaviour 5−8^{5-8} and its implications for human and social systems 9−12^{9-12}.

Task evaluation provides a starting point for this inquiry. Benchmarks assess performance 13−16^{13-16}, and AgentBoard tracks progress towards task completion 17^{17}. Broader evaluation frameworks relate task demands to model capabilities 18^{18}. Behavioural studies test specified actions such as self-correction, verification and backtracking 19−21^{19-21}; MAST develops failure categories from interaction traces and investigates targeted changes 22^{22}. An account of this process connects these measurements, interpreting each action in relation to preceding events and subsequent responses.

Such an account begins with identifying what to observe. Developing behavioural categories from recorded activity allows recurring patterns and unexpected responses to shape the analysis. Inductive coding offers one approach to developing these categories, or codes 23,24^{23,24}. Explicit definitions locate instances in a trajectory; their positions distinguish checking before an action from checking after an error. The resulting measurements retain the behavioural meanings needed to interpret relationships across the process.

We propose a general framework that connects behavioural discovery, analysis of trajectories and experimental investigation (Fig. 1). It draws on the behavioural sciences' emphasis on observable activity and context 25−30^{25-30}. Behavioural definitions connect the stages: the activity identified in a record is also the object of analysis and experimental measurement. Statistical assessment quantifies evidence for learned relationships; testing in held-out contexts examines how far they extend. These relationships guide experiments that vary instructions or interaction conditions and measure the resulting behaviours and outcomes. Analytical methods follow the behavioural question. Together, the stages turn recorded processes into interpretable accounts of behaviour that can be tested and refined.

a Behavioural trajectory generation

Proposed framework

01 Specify the subject and generation conditions

Figure

b Data-driven behaviour encoding

c Learning behavioural relations

02 Develop codes; define evidence and alignment

Event-aligned representation ϕ(τ)\phi(\tau)

Figure

Encoding: 1 present, 0 absent, ⊥\perp no opportunity

Codes: R retry, C check, V revise

03 Analyse behavioural relations

Figure

Complexity and process constraints

Candidate dependencies

04 Candidate behaviour identification

05 Tests in held-out contexts

S^={C2,V3}\hat{S} = \{C_2, V_3\}

R2R_{2} C2C_{2} V2V_{2} C3C_{3} V3V_{3}

Task 1

Task 2

Task 3

Statistical support · coding sensitivity · tests in new settings

d Prompt-based steering and behavioural checks

06 Test single and joint instructions

A targets C2C_{2}; B targets V3V_{3}

Assess behaviour in each condition

Figure

Performance comparison

Paired contrasts Δ\Delta; interaction ι\iota

Behavioural assessment

Occurrence of selected behaviours; other changes; length and cost

Compare performance and observed behaviour

Refine behavioural definitions, hypotheses and study conditions

Figure 1. General framework for interpretable behaviour analysis. a, Generation conditions define the agent, its recorded trajectories and an independently specified outcome. b, Categories induced from trajectory records are defined by explicit evidence, opportunities, anchors and actors; ⊥\perp denotes no opportunity. c, Analyses assess statistical support and generalisation, with safeguards against spurious associations. The graph illustrates one possible statistical representation. Highlighted variables are candidate targets; arrows denote dependencies. R, retry; C, check; V, revise; w, event-aligned window. d, Continuations from the same recorded history compare baseline, single-target and joint instructions. Recoding measures targeted and other behaviours; outcomes and cost are recorded for each condition. Findings inform revisions to behavioural definitions, hypotheses and instructions. All matrices and trajectories are schematic.

Our work on ReBeCA 31^{31} provides a concrete illustration in iterative self-reflection. Behavioural descriptions proposed from trajectories and consolidated by human review became variables indexed by round. Causal discovery modelled their statistical dependencies 32−34^{32-34}, identifying small behavioural sets that predicted outcomes better than models using all recorded variables. Their explicit meanings allowed the findings to inform single and combined instructions. Results varied across models and prompt combinations, illustrating the need to examine responses to instruction changes directly 35^{35}. ReBeCA thus connects behavioural discovery to interpretable hypotheses and experimental comparisons. We develop this logic for trajectories whose length, event order and agent roles vary.

a Roles, triggers and event-anchored windows

Illustrative coding design

Figure

The trigger defines the occasion; the role identifies whose behaviour is coded.

b Evidence for behavioural coding

§ “I will verify”statement
A verify(result)action
C answer revisedchange
Y final answeroutput

c Opportunity-aware coding

RunRecorded eventsBinaryAware
1△11
2△ no retry00
3no error0⊥

d Event-based alignment

Figure

Figure 2. Measuring behaviour in context. a, An illustrative coding design includes three agent roles and an environment. Roles and event-anchored windows locate records of statements, executed actions and tool errors within the trajectory. b, Statements, executed actions, subsequent changes and output properties provide distinct types of evidence. c, A binary absence code merges an error without recovery with an episode without an error. Opportunity-aware coding uses ⊥\perp for no opportunity; shared opportunities can themselves induce dependencies. d, The same triggering event can occur at different ordinal steps. Event-aligned windows compare the corresponding occasions rather than a fixed step number. All examples are schematic.

Learning behavioural variables from trajectories

A behavioural account begins with categories that reflect the activity being studied. An episode is one run of an agent on a problem; its trajectory records that run's messages, actions and observations. In ReBeCA, a language model proposed candidate behavioural descriptions, which human review consolidated 31^{31} . More systematic category development can draw on inductive coding 23,24^{23,24} and language-model-assisted approaches 36,37^{36,37} . The aim is to let patterns in the records shape what enters the analysis.

The range of those records matters. Sampling diverse trajectories, including unusual responses, broadens the activity from which categories can emerge. Withholding outcomes during category development separates the identification of behaviour from its subsequent association with success. Comparing candidate categories against supporting and contrasting passages helps refine definitions, consolidate overlaps and uncover omissions. Separate development records provide a further test of coverage. Once the rules are fixed, independent trajectories allow assessment of per-category errors and human disagreement. These comparisons make the influence of sampling and interpretation open to inspection.

Category development leads to a measurement problem: the same behavioural description can refer to different activity depending on its evidence and context. Ethograms similarly define observable units of behaviour 25,26,38−40^{25,26,38-40} . For agents, preserving that meaning requires connecting each coded occurrence to the record, its occasion, its position and the actors involved (Fig. 2).

The evidence establishes what a code measures. “I will verify the result”, a verification call, a subsequent revision and a correct final answer are distinct observations. Studies of verbal reasoning show why its correspondence with the model’s computations warrants assessment 41−45^{41-45} . A codebook can distinguish statements, executed actions and recorded state changes, and use counts, duration or latency where these answer the behavioural question (Fig. 2b).

An occurrence also has meaning relative to the opportunity for it. Recovery after a tool error requires an error; responding to an objection requires an objection. Distinguishing a response, absence despite an opportunity and no opportunity preserves this context. Shared opportunities can themselves induce dependencies. Representing the opportunity alongside the response allows both to be studied; restricting analysis to episodes where it arose instead concerns behaviour given that opportunity (Fig. 2c).

The same need for context extends to temporal position. Fixed reflection rounds provide common positions, whereas the fifth message of an open-ended episode can serve different purposes across runs. Windows anchored to a tool error, objection or hand-over offer a basis for comparison. Their interpretation depends on how absent and repeated events, overlapping windows and asynchronous actions are represented. Anchoring at the first occurrence gives one window per episode and confines the analysis to that occasion (Fig. 2d).

Within such a window, the trigger and the actor's role further specify the behaviour. A timeout and an invalid argument can call for different responses. An objection from a reviewer to a worker differs from one raised by a worker to a planner. Recording these distinctions, tool returns and external state lets a category retain the context in which an action occurred (Fig. 2a). Together, these choices turn descriptions into measurements of activity within a process.

The generation conditions give those measurements their empirical scope. With model parameters fixed and memory and external state reset, repeated episodes can be generated without learning from previous runs. Where the relevant state can be restored, alternative continuations can begin from the same history 42,46^{42,46}. Such comparisons depend on access to the agent's state and environment. Expectations of training or evaluation can also change behaviour 47,48^{47,48}. Recording these conditions makes it possible to relate learned patterns to the circumstances that produced them.

References (85)