Manuscript Offprint
arXiv:2610.40006Human--AI Interactions as First-Class Data: A Formal Interaction Model and Runtime for Explainable AI Collaboration
Open access. PaperVantage converted this article to text, so layout and figures may differ from the original.
Michela Taufer
University of Tennessee
Knoxville, USA
Kin Wai NG
University of Tennessee
Knoxville, USA
Ian Lumsden
University of Tennessee
Knoxville, USA
Aashish Pandey
University of Tennessee
Knoxville, USA
Rajasi Gore
University of Tennessee
Knoxville, USA
Angelina Ju
University of Tennessee
Knoxville, USA
Sukanya Moudgalya
University of Tennessee
Knoxville, USA
Ewa Deelman
University of Southern California
Marina del Rey, CA, USA
Sai Swaminathan
University of Tennessee
Knoxville, USA
Abstract—AI assistants are increasingly embedded in computational notebooks, scientific workflows, software engineering tools, and learning systems, yet human–AI interactions are often treated as transient prompt–response exchanges rather than durable data products, hindering reproducibility, explainability, replay, behavioral analysis, and adaptive AI support. We argue that these interactions form a new data class requiring formal representation and introduce the Human–AI Interaction Description Language (HAIDL), a formal interaction model with a Backus–Naur Form-inspired concrete syntax. HAIDL encodes each interaction as a structured object capturing computational context, user request, prompt payload, AI response, feedback, problem context, provenance, and model metadata. We integrate this vision into HAIDL-X, a middleware for JupyterLab that instantiates HAIDL by capturing user-bot state, building contextualized prompts, interfacing with AI providers, collecting feedback, and storing interactions in a repository. We add a learning layer over HAIDL that maps interaction objects and notebook execution traces into reproducible measures of user behavior, including engagement, performance, help-seeking, error-oriented use, and learning personas. HAIDL-X provides a foundation for treating human–AI collaboration as structured, queryable, replayable, analyzable data.
Index Terms—Human-AI interaction, interaction data, AI middleware, provenance, learning analytics, JupyterLab, large language models, Big Data infrastructure
I. INTRODUCTION
Foundation models are being woven into computational work at every scale: they draft and debug code in computational notebooks, steer data analyses, configure scientific workflows [1], and act as agents in campaigns spanning edge, cloud, and HPC systems [2]. Computational results are therefore no longer produced by humans or machines alone but through sustained human–AI exchanges, which now shape what gets computed, how errors are resolved, and which conclusions are drawn. Consider an AI assistant embedded in a computational notebook. A user who never invokes it looks, in the AI logs, like a failure of adoption—but zero interactions are ambiguous: the user may be progressing independently, or stuck and never seeking help, and the logs cannot tell these apart though they call for opposite responses. Heavy use is just as ambiguous: two users may each invoke the assistant a dozen times with nearly identical transcripts, where one is debugging—each request follows a runtime error, each response followed by a code change and a successful re-execution—while the other extracts answers, pasting responses forward without attempts in between. Counted as prompts, these users are identical; as collaborations, they could not be more different. Human–AI collaboration is not explainable: when AI assistance fails, misleads, or simply goes unused, we cannot reconstruct why. This is not for lack of logging—emerging telemetry standards record, in structured form, what the model saw and said: prompts, responses, token counts, tool calls, and latencies [3]—but such records cannot answer what an explanation requires: (1) what computational state led a user to request assistance; (2) what role that assistance played (error recovery, a next step, a concept, validation); (3) across a community of users, who is helped, who overrelies, and who struggles in silence. Nor can such records support auditing or reproducing AI-assisted portions of a result after the fact. Answering these requires recording the human side of each exchange—the computational state that motivated it and the actions that followed; today's logs do neither. Existing approaches each capture one side of this coupling (Section IX surveys these in detail): observability conventions such as OpenTelemetry GenAI [3] instrument the model side but omit user context and downstream actions; provenance models, from W3C PROV [4] to PROV-AGENT [2] and LLMography [5], trace agent actions within workflows but do not treat the request–response–assessment cycle as a first-class unit; and programming-process formats such as ProgSnap2 [6] standardize the human side but predate AI assistance, while transcript-only studies [7] lack the com-putational state needed to ground inferred intent. No existing representation couples both sides of a human–AI exchange or defines semantics for deriving knowledge from it. We provide that representation: the Human–AI Interaction Description Language (HAIDL), a formal language that models each human–AI exchange as a single structured object spanning the computational state that motivated the request, the contextualized prompt, the AI response, the user's assessment, and full provenance. HAIDL pairs this grammar with an explicit derivation relation ( ) that turns stored interactions into inspectable knowledge—for example, resolving whether a user with zero interactions was progressing independently or was stuck and never sought help. We instantiate HAIDL in HAIDL-X, a human–AI middleware for JupyterLab, and validate it through a semester-long capture of interactions in a university computing course: 35 students, four programming assignments, 800 recorded interactions, and 140 student–assignment pairs, reproducing the ambiguities above in real data. This paper makes four contributions:
• The HAIDL representation. A formal model of human–AI interactions as first-class, self-contained data objects, defined by a BNF-inspired grammar over seven semantic components—computational context, request, prompt, response, feedback, problem context, and model provenance—with a derivation relation separating observed data from inferred knowledge (Section III).
• A human–AI middleware for runtime capture. HAIDL-X instantiates HAIDL during live computational work: capturing notebook state per request, constructing contextualized prompts, communicating with interchangeable AI providers, collecting feedback, and persisting interaction objects in a queryable repository (Section IV).
• Knowledge extraction, demonstrated in a case study. We define derivation rules composing HAIDL objects with observed execution evidence to recover the role each request played, the trajectory of use over an assignment, and the collaboration patterns behind it—resolving the opening ambiguities: among 37 student–assignment pairs with no recorded interactions, distinguishing students progressing alone from those stuck and never asking (Sections VI–VII).
• Empirical quantification of system cost. We measure the latency, storage, and retrieval overhead HAIDL-X adds to an AI exchange, showing the cost of turning a transient conversation into a persistent, explainable record (Section VIII).
where is the computational state before the interaction, the user request, the AI response, the user's assessment of that response, and the updated state. Unlike traditional chat logs, this explicitly models how interactions transform computation rather than recording exchanged messages. A sequence of interactions forms an interaction trajectory,
describing the evolution of a collaborative problem-solving session and supporting analysis of interaction strategies, learning behaviors, and AI effectiveness over time. This is the data problem raised in Section I: interactions become structured entities to be represented, stored, queried, replayed, and analyzed, like database records or provenance objects in scientific workflows. Figure 1 illustrates this lifecycle. Every interaction consists of three conceptual stages.
• User Request. A user in a computational environment submits a request based on the current state (source code, outputs, errors, and problem description), informing both the immediate question and the broader task.
• AI Response. Using this context, the AI constructs a contextualized prompt and returns guidance—explanations, debugging help, code suggestions, or conceptual clarification—emphasizing collaborative reasoning rather than mere text.
• Interaction Assessment. The user evaluates the response explicitly (feedback) or implicitly (editing code, running cells, follow-ups, or abandoning the solution). This assessment defines the next computational state and the starting point for the next interaction.
III. HUMAN–AI INTERACTION DESCRIPTION LANGUAGE
We present the Human–AI Interaction Description Language (HAIDL), a formal language for representing human–AI collaboration as structured data and composing those representations into higher-level interaction knowledge. HAIDL is independent of any AI provider, application, or runtime; its concrete syntax is a grammar inspired by Backus–Naur Form (BNF), while its semantics define how interaction constructs relate to computational state and to one another. The lower part of Figure 1 shows the basic abstraction. Rather than representing the stages of human–AI collaboration as disconnected events, HAIDL groups them into a single interaction object—a self-contained representation of a collaborative episode that can be stored, shared, queried, replayed, and analyzed independently of its original runtime.
A. Design Principles
HAIDL builds on five principles:
-
Completeness: capture the full lifecycle of an interaction, not only the prompt and response.
-
Modularity: represent interactions through reusable semantic components.
-
Explainability: associate each construct and derived expression with an explicit interpretation.
-
Extensibility: allow new AI models, applications, and metadata without changing the overall language structure.

Fig. 1: Lifecycle of a human–AI interaction. A user request arises from a computational state, the AI returns guidance, and the user evaluates or acts on it. HAIDL represents the full lifecycle as a structured artifact whose outcome seeds the next interaction.
- Composability: allow interaction objects and computational states to be related across time so higher-level knowledge can be expressed and derived.
B. Interaction Objects
At the highest level, HAIDL represents each interaction as a structured object:
where M is record metadata, R the user request, P the prompt payload, A the AI response, F feedback or assessment, C the problem context, and L model metadata. Figure 2 shows this organization: rather than storing prompts and responses separately, HAIDL models each collaborative episode as a single object spanning the computational state that led to the request, the contextualized prompt, the AI response, the user's assessment, and the provenance needed to interpret the interaction—the atomic unit from which more complex HAIDL expressions are built. The interaction is:
Interaction ::= < RecordMetadata, UserRequest, PromptPayload, LLMResponse, Feedback, ProblemContext, ModelMetadata >
The ProblemContext component links an interaction to the motivating task or scientific problem, which is essential because the same observable interaction can mean different things depending on the problem being solved.
C. Recursive Grammar
HAIDL recursively decomposes an interaction into semantically meaningful components. For example, UserRequest records the computational context that motivates assistance:
UserRequest ::= < request_id, user_id, cell_id, Time, code, UserCodeOutputs >
UserCodeOutputs ::= StreamOutput | ErrorOutput
HAIDL Interaction Object ( )

M Record Metadata
Provenance, timestamps, route, and runtime context.
R User Request
User intent with computational state,
code, outputs, and errors.
P Prompt Payload
Contextualized prompt and information
sent to the AI model.
A AI Response
AI-generated response with latency
and timing metadata.
F Feedback / Assessment
User assessment and actions
after receiving the response.
C Problem Context
Assignment or problem identity
providing task context.
L Model Metadata
Information about the AI model
and provider configuration.
Fig. 2: Conceptual organization of a HAIDL interaction object: a single structured object with seven semantic components, forming the atomic unit of human–AI collaboration and the root production of the HAIDL grammar.
StreamOutput ::= < output_type, traceback, text >
ErrorOutput ::= < output_type, traceback, error_type,
error_value >
Prompt construction, AI response, feedback, problem context, and model metadata are represented separately:
PromptPayload ::= < prompt, Time >
LLMResponse ::= < request_id, user_id, response, Time,
llm_latency, server_latency >
Feedback ::= < request_id, user_id, cell_id, FeedbackValue,
Time, problem_label, latency_ms, ts_ms >
FeedbackValue ::= "Yes" | "No" | "Somewhat"
ProblemContext ::= < assignment_name, problem_label >
ModelMetadata ::= < provider, model >
This decomposition separates information typical chat his-tories conflate or omit: the computational state motivating assistance, the contextualized prompt sent to the model, the AI response, the user's assessment, the problem context, and runtime and model provenance. Because each component has explicit semantics, they can be queried independently and then recomposed.
D. From Interaction Objects to Interaction Expressions
The grammar above defines the structure of a single interaction, but human–AI collaboration rarely involves just one exchange. As introduced in Section II (Eqs. 1–2), an interaction changes computational state and a sequence of interactions forms a trajectory . HAIDL supports two composition levels: structural composition combines fields into interaction objects per the grammar, while temporal composition relates objects via their states, timestamps, users, and problem contexts, expressed at the language level as:
InteractionTrajectory ::= Interaction* InteractionData ::= Interaction | InteractionTrajectory | ExecutionState
An Interaction is a single collaborative episode, an InteractionTrajectory is an ordered sequence of such episodes, and ExecutionState provides observable computational links between them. Together, these form the substrate for expressing higher-level interaction knowledge.
E. From Syntax to Knowledge
The distinction between representation and knowledge derivation is central to HAIDL. The BNF-inspired production operator ::= defines valid language constructs and their structure but does not infer the meaning of observed behavior. We introduce a separate knowledge-derivation relation,
where are HAIDL interaction-data expressions and is knowledge derived from their relationships; explicitly links observable data to a higher-level interpretation. For example, ErrorOutput appears directly in a UserRequest, so it is interaction data, not inferred knowledge. When that error occurs in the computational state prompting an AI interaction, however, it can support a higher-level interaction expression:
ErrorOutput( ), ErrorRecovery( )
(5)
Similarly, knowledge can be derived from relationships across multiple interactions and computational states:
The exact meaning of depends on the derivation rule and domain—repeated help seeking, validation of AI guidance, progress following assistance, or another domain-specific pattern. This separation gives HAIDL two complementary roles: (1) a language for representing and composing interaction data, and (2) rules for deriving higher-level knowledge from those representations, turning relationships among interactions into inspectable knowledge. In HAIDL, interactions are therefore not only queryable, replayable, and analyzable data objects, but the primitives of a compositional language for human–AI collaboration: its grammar defines syntax, its derivation relation defines semantics, and HAIDL-X provides the runtime that instantiates it from real interactions (Section VI).
IV. HAIDL-X: AN AI MW FOR SCIENTIFIC COMPUTING
HAIDL specifies how human–AI interactions are represented; HAIDL-X is the runtime that realizes this representation as first-class data during execution: a human–AI middleware that augments computational notebooks with context-aware assistance while capturing every interaction as a structured, persistent record. We target JupyterLab [8], the interactive computing environment now standard in data science. Rather than a monolithic assistant, HAIDL-X is a layered middleware separating user interaction, interaction capture, AI communication, interaction representation, and persistent storage, letting each layer evolve independently while preserving one common interaction model.
A. Software Architecture
HAIDL-X comprises six cooperating layers.
• JupyterLab Extension. Integrates HAIDL-X into JupyterLab, letting users request assistance and receive responses without leaving the notebook.
• Frontend Client. Captures the computational context for each request—source code, executed cells, outputs, errors, timestamps, notebook metadata—packaging it into structured interaction requests.
• Backend Server. Validates requests, enriches them with context, builds contextualized prompts, invokes external AI providers, and records runtime metadata.
• HAIDL Interaction Layer. Gives the middleware a common representation independent of AI provider or notebook environment; components exchange structured HAIDL objects rather than provider-specific messages.
• Provider Abstraction Layer. Decouples provider-specific APIs from the interaction model, so new foundation models can be integrated without changing HAIDL or the middleware itself.
• Interaction Repository. Persists completed interactions as HAIDL objects in a MongoDB repository, including provenance, timestamps, user assessments, and model information, supporting replay, querying, and behavioral analytics.
B. Capture Pipeline, Repository, and Provider Independence
These six layers execute in sequence for each request: the frontend captures computational state and packages it into a structured request; the backend builds a contextualized prompt and invokes the selected provider through the abstraction layer; the response and context are combined into a HAIDL object with explicit feedback when available; and the completed object is persisted to the repository. This pipeline is what makes human–AI interaction first-class data in practice: instead of ephemeral, implementation-specific chat logs, every interaction becomes a computational artifact—indexed, queried, replayed, and analyzed across sessions, users, assignments, and providers. Because interaction representation is decoupled from model execution, the same HAIDL object results across different AI models.
V. DEPLOYMENT AND DATA COLLECTION
We deployed HAIDL-X in a university Data Engineering course to evaluate HAIDL with interactions from authentic computational work, yielding two complementary views of student activity: HAIDL-based records captured when students interacted with HAIDL-X, and execution evidence preserved in submitted Jupyter notebooks. This section describes the deployment and data preparation; interaction-knowledge derivation is presented in Section VI.
A. Classroom Deployment
HAIDL-X was integrated directly into the JupyterLab environment used by students for programming assignments. When assistance was requested, HAIDL-X captured the active cell code and its available execution output, constructed a context-aware request, routed it to the AI provider, returned the response in the notebook, and persisted the interaction through the HAIDL capture pipeline. The deployment involved 35 students and four programming assignments, yielding 140 student-assignment pairs. The assignments spanned different tasks and complexity: Assignment 03 focused on mathematical and algorithmic problem solving, Assignment 04 on text processing and exploratory analysis, and Assignments 07 and 08 introduced distributed data-processing tasks using PySpark (distributed k-means and a machine-learning pipeline, respectively). HAIDL-X was used during regular assignments, capturing interactions as students wrote, executed, debugged, and inspected notebook code.
B. Experimental Design
The classroom deployment used a crossover design. Group A had access to HAIDL-X for Assignments 03 and 07, while Group B had access for Assignments 04 and 08. Each group served as the no-access condition for the other assignments, enabling comparisons based on HAIDL-X availability. Assigned access and observed use are not equivalent, however—some students with access never invoked HAIDL-X, while others used it outside the assigned-access condition—so we retain these cases rather than discard them, since the distinction between access and actual use is itself relevant context. The analysis therefore treats the student-assignment pair, not the student alone, as its primary unit.
C. Data Sources
The deployment produced two complementary data sources:
a) HAIDL interaction data: HAIDL-X persisted each observed AI interaction as structured interaction data. Depending on the available context, records include the student identifier, assignment and notebook-cell identifiers, source code, execution outputs or errors, contextualized prompt, AI response, timestamps, model information, latency metadata, and explicit user feedback. These records provide evidence for AI-use measures and semantic interaction events in Section VI.
b) Notebook execution data: Submitted Jupyter notebooks provide an independent record of computational activity. We analyze notebook cells implementing assignment logic, excluding markdown and timing-only cells. A cell is touched when the notebook shows evidence it was executed; among touched cells, one that completes without a Jupyter execution error is successfully executed, one producing an error is unsuccessful, and cells without execution evidence are not executed. These execution-based proxies do not imply a logically correct solution, but provide observable evidence of how far students progressed and how extensively they interacted with an assignment's code cells. The two sources capture different aspects of the same activity: notebook traces describe what happened during computation, including activity where HAIDL-X was never invoked, while HAIDL objects describe what happened when AI assistance was requested. Neither source alone provides the combined view used in our knowledge derivations.
D. Data Preparation and Alignment
We aligned the two data sources around the student–assignment pair: notebook execution records were reduced to the assignment-relevant code cells described above, and HAIDL-X interaction records were grouped by student and assignment and, when a cell identifier was available, linked to the corresponding notebook cell. Within each pair, interactions were ordered by timestamp, preserving the temporal structure HAIDL requires and allowing multiple requests to be represented as a trajectory. The resulting analysis record connects three forms of evidence:
where denotes notebook execution evidence for student u on assignment a, the corresponding HAIDL interaction objects, and the assigned HAIDL-X access condition. We preserve these sources separately rather than collapsing them during preprocessing, so that execution behavior, AI interaction behavior, and experimental context remain independently inspectable and are composed only through the explicit derivation rules of Section VI.
VI. FROM INTERACTION DATA TO KNOWLEDGE
Representing human–AI interactions as first-class data is useful only if the representation supports reasoning beyond individual records. HAIDL is both a grammar for describing interaction objects and a language for deriving higher-level knowledge; its core idea is composition: observable fields describe individual events, relationships among events describe behavior, and sequences of behaviors reveal higher-level patterns. We illustrate this in a learning scenario—not to recast HAIDL as a language dedicated to learning tasks, but to show how the interaction primitives of Section III combine with domain-specific observations to infer knowledge not explicitly contained in any single interaction record.
A. From Observations to Derived Knowledge
HAIDL distinguishes three levels of representation:
Observation ::= Interaction | ExecutionState InteractionKnowledge ::= InteractionEvent | InteractionTrajectory | BehavioralState
An Observation is directly captured data. An Interaction is a HAIDL object , and an ExecutionState is the observable notebook state for that interaction (e.g., executed code, outputs, or errors). InteractionKnowledge, in contrast, is derived by relating observations. For instance, an ErrorOutput is an observation, while using AI assistance in response to that error is an ErrorRecovery event. Likewise, multiple interactions showing persistent lack of progress can form RepeatedHelp. These higher-level constructs are reproducible expressions over HAIDL fields and computational observations, not extra labels stored apart from the interaction data. We use the derivation operator to distinguish knowledge derived from HAIDL observations from the BNF productions that define their concrete representation:
where are observable interaction or execution objects and K is a derived knowledge construct.
B. Deriving Interaction Events
The first level of knowledge describes the apparent role of an AI interaction in the user's computational activity:
InteractionEvent ::= ErrorRecovery | StuckNextStep | ConceptualHelp | Validation
These events are not independent fields in the interaction repository; they are derived from combinations of HAIDL components and notebook state, with intent inferred from the source cell, execution outputs, errors, and the request-response pair. For example, an error in the computational state for an interaction indicates a need for error-oriented help:
ErrorOutput( ), ErrorRecovery( )
An interaction associated with incomplete code or an unfinished computational step provides evidence for:
IncompleteState( ), StuckNextStep( )
Requests for explanations or clarification are labeled ConceptualHelp, while requests to inspect or check ongoing work are labeled Validation. These categories describe HAIDL-X's observable role in the workflow rather than the user's underlying intent. Their value lies in being derivable, inspectable, and reproducible from interaction data.
C. Composing Events into Interaction Trajectories
Individual events show how AI is used at one moment. HAIDL's state-transition model also allows composing events over time. For a learner u and assignment a, we define:
where interactions are ordered by their timestamps.
InteractionTrajectory ::= InteractionEvent*
The trajectory permits knowledge to be expressed over relationships among interactions and subsequent computational states. Two useful derived constructs are:
TrajectoryEvent ::= RepeatedHelp | NoProgress
Conceptually, repeated help seeking consists of an interaction event followed by a no-progress state and another interaction:
InteractionEvent → NoProgress → InteractionEvent ⇒ K RepeatedHelp
Likewise, an interaction followed by execution with no observable progress is NoProgress. These constructs highlight a key property of HAIDL: knowledge can be expressed not only over fields within an interaction object, but over relationships among objects and the computational states connecting them.
D. Composing Interaction and Domain Knowledge
The previous constructs are domain-independent descriptions of interaction behavior; applications can combine them with domain-specific observations to derive richer knowledge. In our classroom deployment, notebook execution provides evidence about student performance and engagement, so for each student u and assignment a, we define:
Here, successful execution is used as a performance proxy rather than proof of semantic correctness. These measures produce four relative learning profiles:
LearningProfile ::= HPHE HPLE LPHE LPLE HPHE ::= HighPerformance + HighEngagement HPLE ::= HighPerformance + LowEngagement LPHE ::= LowPerformance + HighEngagement LPLE ::= LowPerformance + LowEngagement
Interaction objects provide complementary measures, with :
BotIntensity(u, a) = N(u, a);
ErrorUse(u, a) = ;
FeedbackRate(u, a) = .
These measures remain traceable to notebook observations or HAIDL components.
E. Deriving Behavioral States
The classroom deployment provides an additional contextual observation: whether HAIDL-X was expected to be available for a given student–assignment pair, encoded as:
ExposureStatus ::= ExpectedUser | ExpectedNonUser | Control | CrossConditionUser
An ExpectedUser had assigned access and used HAIDL-X; an ExpectedNonUser had assigned access but did not use it; a Control had no assigned access and did not use the system; and a CrossConditionUser used it despite not having assigned access. Thus, learning profile, exposure status, and interaction knowledge can now be combined.
LearningTrace ::= Learner | Assignment | ExposureStatus | LearningProfile | InteractionTrajectory | BehavioralState BehavioralState ::= SelfSufficient | ExploratoryOverUser | DisengagedStruggler | ScaffoldedLearner | CrossConditionUser
For example, the analysis interprets an expected non-user with high performance as self-sufficient, whereas an expected non-user with low performance is interpreted as a disengaged struggler:
ExpectedNonUser + HighPerformance SelfSufficient;
ExpectedNonUser + LowPerformance DisengagedStruggler
For students expected to use HAIDL-X, interaction patterns further refine interpretation. Low performance paired with productive help-seeking—long studied in intelligent tutoring systems [9]—or sustained engagement indicates a scaffolded learner, where ProductiveHelp aggregates error-recovery, next-step, and conceptual-help interactions:
ExpectedUser + LowPerformance+
(ProductiveHelp V HighEngagement) ScaffoldedLearner
High performance together with comparatively high AI use dominated by validation-oriented interactions evidences exploratory over-use, while cross-condition use is retained explicitly rather than interpreted as a normal help-seeking persona:
ExpectedUser + HighPerformance + HighBotUse + ValidationDominant
ExploratoryOverUser;
CrossConditionUse CrossConditionUser
These behavioral states are not diagnoses or intrinsic student traits. They are reproducible interpretations of observable behavior for a particular student–assignment pair.
F. What the Language Reveals
The resulting hierarchy is:
Observations → Interactions → Events → Trajectories → Behavioral Knowledge
capturing the distinction between storing interaction data and reasoning over it: a runtime error is an observation; an AI request made in that context is error-recovery behavior; multiple such events form a trajectory; and combined with execution-derived performance, engagement, and experimental context, a trajectory supports a behavioral interpretation. Conventional chat histories preserve text exchanges but lack a common semantic representation connecting the request to computational state, errors, task context, feedback, and subsequent interactions; HAIDL makes these relationships explicit and derivable through inspectable rules. The classroom deployment demonstrates this capability, but the mechanism is not inherently educational—the same domain-specific state and derivation rules could instead express interaction knowledge about scientific workflows, software debugging, or other forms of human–AI collaboration. HAIDL's contribution is thus a compositional language, not a fixed taxonomy of learning behaviors.
VII. CASE STUDY: DERIVING INTERACTION KNOWLEDGE
We apply the Section VI framework to the classroom deployment in Section V, covering 140 student–assignment pairs from 35 students across four assignments and combining notebook execution data, HAIDL-X interaction logs, and access conditions. Our goal is not to estimate HAIDL-X's causal effect on performance, but to test whether first-class interaction data let us distinguish forms of human–AI behavior that are ambiguous from notebook traces or AI logs alone.
A. Interaction Behavior and Learning Profiles
We first examine interaction events derived from HAIDL-X records, classifying each event's role (Section VI-B) from the source cell, execution state, errors, and request-response pair; we then examine notebook-derived learning profiles from performance and engagement proxies. Table I reports both distributions by assignment. Interaction events varied substantially across assignments. Assignment 03 (algorithmic problem solving) generated the most stuck/next-step, error-recovery, and validation requests. Assignment 04 shifted toward conceptual help and error recovery, while PySpark Assignments 07 (k-means) and 08 (a multi-stage MLlib pipeline) were dominated by error recovery, with Assignment 08 also generating substantial conceptual help. Thus, a simple “number of prompts” metric obscures important differences: the same HAIDL-X call can serve different roles depending on the task and execution state. HAIDL captures these differences by linking each request to its execution context.
The learning profiles add important nuance. The first two assignments are dominated by High-Performance/High-Engagement (HPHE) and Low-Performance/Low-Engagement (LPLE), while the Spark assignments introduce Low-Performance/High-Engagement (LPHE) students (8 pairs in Assignment 07 and 6 in Assignment 08), with no HPLE cases. LPHE captures engaged struggle: students who touched many cells but completed few. In contrast, LPLE combines low performance with low activity. Interaction counts alone reveal little about outcomes: across all 140 pairs, interaction count has only weak correlations with successfully executed cells (r = 0.12) and touched cells (r = 0.12). Thus, frequency alone does not indicate whether HAIDL-X helped or hindered performance; events and learning profiles instead provide complementary views of how AI was used.
B. Exposure and Derived Behavioral States
The crossover design separates availability from actual use; combining it with learning profile and interaction behavior (Section VI-E) yields the behavioral states below. Table II reports both distributions by assignment; Cross-Condition is listed once, since a cross-condition user's exposure and behavioral-state counts coincide by definition. Two exposure results stand out. Assigned access did not guarantee use: 37 student–assignment pairs had access but no interactions, so non-use cannot be equated with unavailability. Conversely, 26 pairs used HAIDL-X outside their assigned-access condition—occurring in every assignment, largest in
TABLE I: Derived interaction events and notebook-derived learning profiles by assignment.
| Assign. | Interaction Events | Learning Profiles | ||||||
|---|---|---|---|---|---|---|---|---|
| Error | Stuck/Next | Concept. | Valid. | HPHE | HPLE | LPHE | LPLE | |
| 03 | 44 | 67 | 2 | 21 | 19 | 0 | 0 | 16 |
| 04 | 106 | 0 | 163 | 14 | 18 | 0 | 0 | 17 |
| 07 | 31 | 37 | 5 | 0 | 22 | 0 | 8 | 5 |
| 08 | 150 | 13 | 119 | 3 | 19 | 0 | 6 | 10 |
TABLE II: HAIDL-X exposure states and derived behavioral states by assignment.
| Assignment | Exposure States | Behavioral States | ||||||
|---|---|---|---|---|---|---|---|---|
| Exp. User | Exp. Non-User | Control | Self-suff. | Diseng. | Scaffolded | Expl. Over. | Cross-Cond. | |
| 03 | 9 | 8 | 12 | 4 | 4 | 8 | 1 | 6 |
| 04 | 9 | 9 | 7 | 7 | 3 | 8 | 0 | 10 |
| 07 | 7 | 10 | 14 | 5 | 5 | 7 | 0 | 4 |
| 08 | 8 | 10 | 11 | 7 | 5 | 6 | 0 | 6 |
Assignment 04 (10 cases)—undermining a simple treatment-versus-control reading; we keep these separate rather than folding them into expected-user or control. An interaction log alone cannot show whether use was expected under the design, nor distinguish a control student from one who simply did not seek help; only combining HAIDL records with experimental context resolves these cases. The behavioral states follow the same logic. ScaffoldedLearner appears in all four assignments (29 pairs total)—students with need or difficulty who used HAIDL-X for debugging, next-step, or conceptual support, evidence many used the assistant as intended. DisengagedStruggler also appears in every assignment (three to five cases each): students with access and weak notebook outcomes but little or no HAIDL-X use, indistinguishable from self-sufficient students in the AI log alone but separated by notebook evidence. Self-sufficient students combine strong notebook performance with non-use, indicating independent progress rather than hidden struggle. Exploratory over-use appears only once, with no consistent AnswerExtractor cases, so this deployment mixes productive scaffolding, independent work, and unmet need rather than indiscriminate AI dependence. The 26 cross-condition pairs are analyzed separately, since the design does not support treating them as typical assigned-access help seeking.
C. What the Derived Knowledge Reveals
Analyzing interaction data and notebook execution evidence separately, then combining them, is more informative than either alone, in four ways. Interaction counts conceal how AI is used: HAIDL-X's role shifts with the task—next-step help and validation for Assignment 03, error recovery for Assignment 07, conceptual and error recovery for Assignments 04 and 08—a distinction simple request counts cannot reveal. Notebook traces distinguish forms of struggle: the Spark assignments surface LPHE students who keep attempting cells despite limited success, an engaged-struggle state distinct from LPLE, with HAIDL records showing whether they seek debugging, conceptual, or next-step help. Zero AI interactions are ambiguous: a non-user with strong performance suggests self-sufficiency, a non-user with weak performance a disengaged struggler—identical states in the AI log alone. Observed use and experimental exposure are not equivalent: the 26 cross-condition cases show a simple used/did-not-use variable can- not capture real deployment, since HAIDL records observed behavior while the access schedule supplies context to interpret it. These results do not show that HAIDL-X improves learning, nor is that their purpose; they support this paper's central claim that structured interaction data, combined with computational and experimental evidence, yields knowledge none of these sources provides alone—every behavioral state traces back to specific HAIDL fields, notebook observations, and derivation rules, the practical value of treating human–AI interactions as first-class data.
VIII. COST OF FIRST-CLASS INTERACTION CAPTURE
Treating human–AI interactions as first-class data requires HAIDL-X to capture computational context, build a HAIDL object, store it, and retrieve its components for analysis—steps adding runtime and storage overhead beyond the model invocation. This section's goal is narrow: measuring that overhead, not benchmarking providers or model quality.
A. Capture Overhead
For each HAIDL-X interaction, we measure two latencies: the server-side request latency , spanning the complete request callback—collecting notebook state, building the request, invoking the LLM, assembling the HAIDL object, and persisting it—and the LLM invocation latency alone. The additional cost attributable to first-class capture is therefore
i.e., the processing HAIDL-X adds beyond the LLM call itself. Varying the AI provider, LLM model, and number of concurrent client requests, Figure 3 shows overhead growing steadily with concurrency yet staying within 25ms across all configurations—confirming our runtime introduces negligible, provider-agnostic overhead and remains practical for interactive notebook use.
B. Persistence Cost
Persisting an interaction as a HAIDL object incurs storage and database-write costs, with object size depending on the amount of source code, execution output, traceback information, prompt context, AI response, and metadata. Table III reports these sizes and persistence times: object sizes vary substantially (median 4.53 KB, P95 61.79 KB), yet persistence

(a) Azure: o4-mini

(b) vLLM: ministeral-3-14b

(c) Sambanova: gemma-4-31B-it
Fig. 3: Per-model overhead distributions across concurrent clients and three providers (Azure, vLLM, Sambanova), showing consistently low, provider-agnostic overhead.
TABLE III: Persistence and retrieval characteristics of HAIDL objects and queries.
| Measure | Median | P95 |
|---|---|---|
| HAIDL object size (KB) | 4.53 | 61.79 |
| Persistence latency (ms) | 1.40 | 1.97 |
| Retrieval: student-assignment (ms) | 0.399 | 0.581 |
| Retrieval: error-containing (ms) | 0.399 | 0.711 |
| Retrieval: ordered trajectory (ms) | 0.401 | 0.652 |
latency remains low (median 1.40 ms, P95 1.97 ms) even for the largest objects.
C. Retrieval Cost
First-class interaction data are useful only if stored representations can be efficiently retrieved. We evaluate three queries corresponding to the derivations in Sections VI and VII: (1) all interactions for a student and assignment, (2) interactions containing an ErrorOutput (evidence for ErrorRecovery), and (3) temporally ordered interactions for an InteractionTrajectory. As Table III shows, all three have similar, low retrieval cost (median 0.4 ms, P95 below 0.8 ms).
D. Discussion
The key systems question is not whether HAIDL-X outperforms an AI provider or database, but whether preserving full interaction context is practical for interactive use. These measurements quantify that cost against the benefit shown in Section VII: preserving computational state, context, provenance, and temporal structure enables knowledge otherwise hard to reconstruct. First-class capture thus trades measurable systems cost for a persistent data product supporting querying, reconstruction, and knowledge derivation.
IX. RELATED WORK
Table IV compares HAIDL against representative systems from three related families; none couples both sides of a human–AI exchange or defines derivation semantics for the coupled record, as detailed below.
A. AI Assistants and Programming Support
AI assistants increasingly support programming through code generation, debugging, and explanation [10], [11], with effective use depending on context, response interpretation, and validation [12]–[15], including in classroom and notebook TABLE IV: What existing representations capture vs. HAIDL. Columns: AI observability (OTel GenAI [3]), agent-centric provenance (PROV-AGENT [2]), and programming-process data (ProgSnap2 [6]).
| Captured information | OTel GenAI | PROV-AGENT | Prog-Snap2 | HAIDL |
|---|---|---|---|---|
| Prompt, response, model meta-data | ✓ | ✓ | — | ✓ |
| Computational state motivating a request | — | ✓ | ||
| User assessment of the response | — | — | — | ✓ |
| User actions after the response | — | — | ✓ | |
| Interaction as an explicit state transition | — | — | — | ✓ |
| Formal grammar with derivation semantics | — | — | — | ✓ |
Captures code states and executions, but has no notion of AI assistance.
Captures workflow-side context for agent decisions, not the user state that motivates a request.
deployments [16]–[18]. Related work infers usage patterns from conversation logs [7], IDE telemetry [19], and large-scale corpora [20], but these are not linked to the computational state motivating each request—reproducing the ambiguities of Section I. HAIDL instead couples request, response, computational context, and assessment in one durable object, turning per-study analysis into queries over a standard representation.
B. Provenance and AI Observability
Provenance systems record processes, dependencies, and execution states for reproducibility [1], [21], [22], built on the W3C PROV model [4] and extended by ProvONE [23], notebook-provenance systems [24], and Workflow Run RO-Crate [25]. Closest to our setting, PROV-AGENT [2] represents AI-agent prompts and decisions as provenance nodes, LLMography [5] derives auditability indicators from LLM conversations, and OpenTelemetry GenAI and OpenInference standardize model-invocation telemetry [3], [26]. This family keys to the model invocation or agent actions, not the user's computational state or assessment (Table IV); HAIDL contributes the human-side coupling and derivation semantics ( ) these models omit.
C. Interaction Data Standards and Formal Models
Interoperable activity standards—ProgSnap2 for programming-process data [6], the Experience API [27], and profile-based event models [28]—predate AI assistance and provide no rules for deriving higher-level constructs from recorded events; such analyses are re-implemented per study. Grammar-based formalisms have separately been applied to constrained generation [29] and workflow resource-allocation [30]. HAIDL applies the same principle, pairing a BNF-inspired grammar with an explicit derivation relation these standards lack (Section VI).
X. CONCLUSION
Human–AI interactions are central to computational and scientific workflows, yet they are still logged only as transient prompts and responses, discarding the computational state, task context, feedback, provenance, and timing needed to understand the collaboration. This paper introduces the Human–AI Interaction Description Language (HAIDL), a formal language that treats each interaction as first-class data: a structured object with composition and derivation semantics relating these objects across states and over time. HAIDL-X instantiates HAIDL in JupyterLab, capturing interaction context, AI responses, feedback, and provenance during live computational work. A classroom deployment demonstrates the value of this representation. HAIDL objects compose into semantic interaction events—error recovery, next-step assistance, conceptual help, validation—and, combined with notebook execution and experimental context, into higher-level behaviors distinguishing independent progress, scaffolded AI use, and disengaged struggle: patterns invisible from interaction counts or notebook traces alone. These results are not a causal claim about AI's effect on learning; they show structured interaction data supports reproducible, evidence-traceable interpretation. The broader contribution is not a classroom taxonomy but a data model and language for preserving human–AI collaboration in queryable, composable form. The same primitives extend to scientific workflows, software development, and AI-assisted experimentation wherever understanding an AI collaborator's role requires more than logging what was said—it requires preserving the state, provenance, and consequences of each exchange. Treating interactions as first-class data is what makes human–AI collaboration inspectable, reproducible, and ultimately explainable.
ACKNOWLEDGMENTS
This work was supported by National Science Foundation Awards #2513101, #2530461, #2449103, #2331152, and #2334945. This work used resources from NAIRR #260183.
REFERENCES
[1] E. Deelman, K. Vahi, G. Juve, M. Rynge, S. Callaghan, P. J. Maechling, R. Mayani, W. Chen, R. Ferreira da Silva, M. Livny, and K. Wenger, "Pegasus, a workflow management system for science automation," Future Generation Computer Systems, vol. 46, pp. 17–35, 2015.
[2] R. Souza, A. Gueroudji, S. DeWitt, D. Rosendo, T. Ghosal, R. Ross, P. Balaprakash, and R. Ferreira da Silva, “PROV-AGENT: Unified provenance for tracking AI agent interactions in agentic workflows,” in Proc. 21st IEEE Int. Conf. e-Science (e-Science), Chicago, IL, USA, 2025.
[3] OpenTelemetry Authors, “OpenTelemetry Semantic Conventions for Generative AI,” https://github.com/open-telemetry/semantic-conventions-genai, 2026, accessed: 2026-08-14.
[4] L. Moreau and P. Missier, “PROV-DM: The PROV data model,” World Wide Web Consortium, W3C Recommendation, 2013, https://www.w3.org/TR/prov-dm/.
[5] M. Bousmah, “LLMography: Transforming human–AI conversations into traceability, oversight, and auditability indicators,” 2026, arXiv preprint arXiv:2606.29437.
[6] T. W. Price, D. Hovemeyer, K. Rivers, G. Gao, A. C. Bart, A. M. Kazerouni, B. A. Becker, A. Petersen, L. Gusukuma, S. H. Edwards, and D. Babcock, “ProgSnap2: A flexible format for programming process data,” in Proc. ACM Conf. Innovation and Technology in Computer Science Education (ITiCSE), Trondheim, Norway, 2020, pp. 356–362.
[7] J. Wang, W. Ma, P. Sun, M. Zhang, and J.-Y. Nie, “Understanding user experience in large language model interactions,” arXiv preprint arXiv:2401.08329, 2024.
[8] T. Kluyver, B. Ragan-Kelley, F. Pérez, B. Granger, M. Bussonnier, J. Frederic, K. Kelley, J. Hamrick, J. Grout, S. Corlay, P. Ivanov, D. Avila, S. Abdalla, and C. Willing, "Jupyter notebooks – a publishing format for reproducible computational workflows," in Positioning and Power in Academic Publishing: Players, Agents and Agendas. IOS Press, 2016, pp. 87–90.
[9] V. Aleven, E. Stahl, S. Schworm, F. Fischer, and R. Wallace, “Help seeking and help design in interactive learning environments,” Rev. Educ. Res., vol. 73, no. 3, pp. 277–320, 2003.
[10] A. Ziegler, E. Kalliamvakou, X. A. Li, A. Rice, D. Rifkin, S. Simister, G. Sittampalam, and E. Aftandilian, “Measuring GitHub Copilot’s impact on productivity,” Commun. ACM, vol. 67, no. 3, pp. 54–63, 2024.
[11] S. Barke, M. B. James, and N. Polikarpova, “Grounded Copilot: How programmers interact with code-generating models,” Proc. ACM Program. Lang., vol. 7, no. OOPSLA1, pp. 85–111, 2023.
[12] P. Vaithilingam, T. Zhang, and E. L. Glassman, “Expectation vs. Experience: Evaluating the Usability of Code Generation Tools Powered by Large Language Models,” in Ext. Abstracts 2022 CHI Conf. Human Factors in Computing Systems, ser. CHI EA '22. New Orleans, LA, USA: ACM, 2022.
[13] J. Prather, B. A. Becker, M. Craig, P. Denny, D. Loksa, and L. Margulieux, “What Do We Think We Think We Are Doing? Metacognition and Self-Regulation in Programming,” in Proc. 2020 ACM Conf. Int. Computing Education Research, ser. ICER '20. Virtual Event, New Zealand: ACM, 2020.
[14] S. Nguyen, H. M. Babe, Y. Zi, A. Guha, C. J. Anderson, and M. Q. Feldman, "How Beginning Programmers and Code LLMs (Mis)read Each Other," in Proc. 2024 CHI Conf. Human Factors in Computing Systems, ser. CHI '24. Honolulu, HI, USA: ACM, 2024.
[15] A. Scholl and N. Kiesler, “How Novice Programmers Use and Experience ChatGPT when Solving Programming Exercises in an Introductory Course,” in 2024 IEEE Frontiers in Education Conf. (FIE), 2024.
[16] M. Kazemitabaar, X. Hou, A. Henley, B. J. Ericson, D. Weintrop, and T. Grossman, "How novices use llm-based code generators to solve cs1 coding tasks in a self-paced learning environment," in Proc. 23rd Koli Calling Int. Conf. Computing Education Research, ser. Koli Calling '23. Koli, Finland: ACM, 2024.
[17] M. Kazemitabaar, R. Ye, X. Wang, A. Z. Henley, P. Denny, M. Craig, and T. Grossman, “CodeAid: Evaluating a Classroom Deployment of an LLM-based Programming Assistant that Balances Student and Educator Needs,” in Proc. 2024 CHI Conf. Human Factors in Computing Systems, ser. CHI '24. New York, NY, USA: ACM, 2024.
[18] A. M. McNutt, C. Wang, R. A. Deline, and S. M. Drucker, “On the design of AI-powered code assistants for notebooks,” in Proc. CHI Conf. Human Factors in Computing Systems, 2023.
[19] H. Mozannar, G. Bansal, A. Fourney, and E. Horvitz, “Reading between the lines: Modeling user behavior and costs in AI-assisted programming,” in Proc. CHI Conf. Human Factors in Computing Systems, 2024.
[20] W. Zhao, X. Ren, J. Hessel, C. Cardie, Y. Choi, and Y. Deng, “WildChat: 1m ChatGPT interaction logs in the wild,” in Proc. Int. Conf. Learning Representations (ICLR), 2024.
[21] S. B. Davidson and J. Freire, “Provenance and Scientific Workflows: Challenges and Opportunities,” in Proc. 2008 ACM SIGMOD Int. Conf. Management of Data, ser. SIGMOD '08. Vancouver, Canada: ACM, 2008.
[22] W. Oliveira, D. D. Oliveira, and V. Braganholo, “Provenance Analytics for Workflow-Based Computational Experiments: A Survey,” ACM Comput. Surv., 2018.
[23] V. Cuevas-Vicentín, B. Ludäscher, P. Missier, K. Belhajjame, F. Chirigati, Y. Wei, S. Dey, P. Kianmajd, D. Koop, S. Bowers, I. Altintas, C. Jones, M. B. Jones, L. Walker, P. Slaughter, B. Leinfelder, and Y. Cao, "ProvONE: A PROV Extension Data Model for Scientific Workflow Provenance," https://jenkins-1.dataone.org/jenkins/job/ProvONE-Documentation-1.0.0/ws/provenance/ProvONE/v1/provone.html, May 2016, version 1.
[24] J. F. N. Pimentel, V. Braganholo, L. Murta, and J. Freire, “Collecting and Analyzing Provenance on Interactive Notebooks: When IPython Meets noWorkflow,” in 7th USENIX Workshop on the Theory and Practice of Provenance. Edinburgh, Scotland: USENIX Association, 2015.
[25] S. Leo, M. R. Crusoe, L. Rodríguez-Navas, R. Sirvent, A. Kanitz, P. De Geest, R. Wittner, L. Pireddu, D. Garijo, J. M. Fernández et al., “Recording Provenance of Workflow Runs with RO-Crate,” PLoS one, vol. 19, no. 9, 2024.
[26] Arize AI, “OpenInference: OpenTelemetry-Native AI Observability,” https://github.com/Arize-ai/openinference, 2026, accessed: 2026-08-14.
[27] J. M. Kevan and P. R. Ryan, “Experience API: Flexible, Decentralized and Activity-Centric Data Collection,” Technol. Knowl. Learn., vol. 21, no. 1, pp. 143–149, 2016.
[28] A. Rayón, M. Guenaga, and A. Núñez, “Supporting Competency-assessment Through a Learning Analytics Approach Using Enriched Rubrics,” in Proc. 2nd Int. Conf. Technological Ecosystems for Enhancing Multiculturality, ser. TEEM '14. Salamanca, Spain: ACM, 2014.
[29] B. Wang, Z. Wang, X. Wang, Y. Cao, R. A. Saurous, and Y. Kim, “Grammar Prompting for Domain-Specific Language Generation with Large Language Models,” in Adv. Neural Inf. Process. Syst., vol. 36, 2023.
[30] T. Estrada, M. Wyatt, and M. Taifer, “A Genetic Programming Approach to Design Resource Allocation Policies for Heterogeneous Workflows in the Cloud,” in 2015 IEEE 21st Int. Conf. Parallel and Distributed Systems (ICPADS), 2015.