[Paper Review] AmadeusGPT: a natural language interface for interactive animal behavioral analysis
AmadeusGPT provides a natural-language interface that translates user descriptions of animal behaviors into executable Python code, leveraging an augmented GPT-3.5 with a dual-memory system and core behavioral modules to enable interactive, code-free behavioral analysis from video data.
The process of quantifying and analyzing animal behavior involves translating the naturally occurring descriptive language of their actions into machine-readable code. Yet, codifying behavior analysis is often challenging without deep understanding of animal behavior and technical machine learning knowledge. To limit this gap, we introduce AmadeusGPT: a natural language interface that turns natural language descriptions of behaviors into machine-executable code. Large-language models (LLMs) such as GPT3.5 and GPT4 allow for interactive language-based queries that are potentially well suited for making interactive behavior analysis. However, the comprehension capability of these LLMs is limited by the context window size, which prevents it from remembering distant conversations. To overcome the context window limitation, we implement a novel dual-memory mechanism to allow communication between short-term and long-term memory using symbols as context pointers for retrieval and saving. Concretely, users directly use language-based definitions of behavior and our augmented GPT develops code based on the core AmadeusGPT API, which contains machine learning, computer vision, spatio-temporal reasoning, and visualization modules. Users then can interactively refine results, and seamlessly add new behavioral modules as needed. We benchmark AmadeusGPT and show we can produce state-of-the-art performance on the MABE 2022 behavior challenge tasks. Note, an end-user would not need to write any code to achieve this. Thus, collectively AmadeusGPT presents a novel way to merge deep biological knowledge, large-language models, and core computer vision modules into a more naturally intelligent system. Code and demos can be found at: https://github.com/AdaptiveMotorControlLab/AmadeusGPT.
Motivation & Objective
- Bridge natural language prompts and behavioral analysis pipelines to reduce the need for coding by life scientists.
- Enable interactive definition and refinement of animal behavior analyses from video data.
- Integrate pose estimation, object segmentation, and spatio-temporal reasoning via a modular API.
- Maintain robust execution with memory mechanisms that overcome LLM context window limits.
- Benchmark performance on standard behavioral datasets to assess practicality and accuracy.
Proposed method
- Augmented GPT-3.5 with a constrained API designed around atomic, reusable functions.
- Dual-memory system with short-term memory for current context and long-term memory using symbol-based pointers for retention across sessions.
- Core behavioral modules for kinematic feature analysis, animal–object/environment state modeling, and spatio-temporal reasoning.
- Integration modules with dynamic loading using embeddings to select task-specific capabilities at inference time.
- Error handling, rephraser for out-of-distribution prompts, and an explainer module to map results back to user queries.

Experimental results
Research questions
- RQ1Can a natural language interface convert user behavioral descriptions into executable Python code that leverages vision models for pose estimation and segmentation?
- RQ2Does the dual-memory mechanism mitigate context-window limitations and preserve task definitions across sessions?
- RQ3How does AmadeusGPT perform on standard behavioral benchmarks compared to traditional machine-learning–based approaches?
- RQ4Can the system support interactive refinement and on-the-fly visualization of behavioral analyses from video data?
Key findings
- AmadeusGPT achieves state-of-the-art-like performance on MABE 2022 behavior challenge tasks using prompt definitions closely aligned with official behavior definitions.
- A dual-memory mechanism effectively preserves defined behaviors and application state across sessions and token-limited interactions.
- The system demonstrates robust behavior analysis across datasets (EPM, MausHaus, MABe 2022) with a primarily rule-based approach requiring few tunable parameters.
- Robustness tests show 88% success on out-of-distribution prompts with a rephraser component, indicating improved reliability in real-world prompts.
- Integration with SuperAnimal pose estimation and SAM enables end-to-end analysis from raw video without coding.

Read this paper
Open the full text in the Nubint reader and ask about any passage as you read.
Read this paper on NubintThis review was generated by AI from the original paper. Please check the paper before citing it.