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.
Paper
Similar papers
Peer review
Summary
This paper presented Amadeus, a natural language interface for interactive animal behavior analysis. To accommodate modern LLM (GPT3.5) for behavior analysis, the authors proposed to use an API document to constrain GPT3.5’s knowledge space. Furthermore, the authors proposed Dual Memory Mechanism to read and write behaviors (symbols) to enable correct long-term memory retrieval and overcame the limit of 4096 tokens. The authors demonstrated results on three standard mouse behavior datasets.
Strengths
(1) The motivation is quite novel. The whole system could provide an unprecedented experience of animal behavior analysis through natural language guidance only. This paper pioneers a practical way to integrate LLM to task programming. (2) The paper is well written. (3) The quantitative result on MABE dataset demonstrates the effectiveness of the system.
Weaknesses
(1) Although the paper has claimed “animal behavioral analysis”, the datasets used are mouse only. I wonder whether it is difficult to transfer the experience of this paper to other animals, e.g. monkeys, zebrafish, etc. The authors should discuss its applicability to other animals. (2) I want to know how many behaviors have been tested on this model. It would be better to list them in the supplementary files.
Questions
(1) Can it extrapolate to behavioral codes that are never seen, and how are the atomic APIs distributed? I mean, the behaviors that could be handled seem to closely related to the capability of atomic API. If the atomic API could not measure animal overlap, would the system work with behavior like "mount" which is closely related to pixel/keypoint/area overlap? (2) What if define a symbol twice with slightly different or totally different descriptions? (3) Mistake: In Figure.3, “Cmpute the pose from the video” -> “Compute …”
Rating
8: Strong Accept: Technically strong paper, with novel ideas, excellent impact on at least one area, or high-to-excellent impact on multiple areas, with excellent evaluation, resources, and reproducibility, and no unaddressed ethical considerations.
Confidence
4: You are confident in your assessment, but not absolutely certain. It is unlikely, but not impossible, that you did not understand some parts of the submission or that you are unfamiliar with some pieces of related work.
Soundness
4 excellent
Presentation
4 excellent
Contribution
4 excellent
Limitations
The authors have addressed limitations.
Summary
This paper proposes AMADEUS, a GPT3.5 powered system to perform animal behavior data analytics given a natural language user-given query and a video depicting animal behavior. The model works by using GPT-3.5 to generate python code which makes calls to a instance segmentation and animal pose model, as well as hard-coded modules to compute animal-object relationships and operates with their outputs to return results according to a given query. The proposed model is tested with 3 popular animal behavior analysis benchmarks, showcasing different domains, queries and tasks, showing behavior consistent with human annotators and surpassing existing baselines.
Strengths
- Related work: The paper is open about closely related work, and assigns credit for the contributions that are used in the AMADEUS system. - Method: - I appreciate the discussion about the design of the API. It would be valuable to understand what would be the effect of not having made the specific choices mentioned in lines 150-159. - I appreciate the Dual Memory Mechanims proposed (includeing the illustrative example of limitations of short context windows). I would like to understand the main differences between that appraoch and the one used in Generative Agents, and a discussion on why their execution flow is more expensive. The memory mechanism also has valuable usability features, such as being able to store and retreive states. - Relying on LLM allows to provide complex data analysis queries that were not possible in previous methods, as well as follow up questions to a given data analysis. - The proposed method, besides flexible is high performing in existing benchmarks, consisting on varied types of queries, expected outputs and data domains. The method perorms above the state of the art, both qualitatively adn quantitatively, surpassing all submissions in the MABE 2022 behavior challenge.
Weaknesses
Novelty: - The work is very similar to existing works using LLMs for computer vision tasks (ViperGPT, VisProg), with the main difference being that they are applied to the animal behavior domain. This is however reported in the related work section, and the work includes other components to handle long duration data. Scope: - This looks more like a systems paper, with many of the contributions already existing in previous works, and the main contribution being in combining these existing contributions for a new domain. I think that the paper does have value, but I am wondering if it is the right scope for NeurIPS. Method: - The performance on the method seems highly dependent on the data analysis modules, which are handwritten. How general are these modules to different kinds of animal behaviors? - I am suspicious of the robustness and stress testing section. The full system relies on GPT3.5, and that same model is used to stress-test the system. I would like to see how good is the performance (with/without rephraser) from independent researcher-given queries.
Questions
NA
Rating
6: Weak Accept: Technically solid, moderate-to-high impact paper, with no major concerns with respect to evaluation, resources, reproducibility, ethical considerations.
Confidence
3: You are fairly confident in your assessment. It is possible that you did not understand some parts of the submission or that you are unfamiliar with some pieces of related work. Math/other details were not carefully checked.
Soundness
3 good
Presentation
4 excellent
Contribution
3 good
Limitations
Limitations are mostly addressed. The biggest missing limitation is how general is this approach to other animal behavior analysis, given the strong dependence on the hand-designed modules.
Summary
This paper proposes Amadeus, a novel natural language-based interface that leverages large language models like ChatGPT and vision-language models like SAM for animal behavior tracking and analysis. Amadeus leverages LLMs to generate code outputs, which can be executed to retrieve visual information and memory information and return requested responses from user queries. In particular, Amadeus proposes a novel dual-memory mechanism that combines short-term and long-term memory banks to effectively analyze extended contexts such as long videos. Experiments demonstrate that Amadeus achieve state-of-the-art performance on the MABE Behavior Challenge 2022 benchmark.
Strengths
- The paper is generally well-written, and the figures are generally informative about the details of each module of Amadeus. - Leveraging recent advancements on LLMs and VLMs to analyze animal behaviors is a novel idea and holds significant potential for scaling up to more complex animal behaviors and a larger number of animals in the future. One of the strengths of this approach is its accessibility and training-free nature, which makes it adaptable to novel scenarios with relative ease.
Weaknesses
In Fig. 4, the implementation of long-term memory storing and retrieval processes is a bit unclear, as the generated code does not explicitly store or retrieve information into / from the long-term memory bank. While the proposed approach achieves the state-of-the-art results on the MABE Behavior Challenge 2022 benchmark, it would be beneficial to include discussions on the failure cases, and analyze their source of failures (e.g., due to mistaken VLM perceptions, or due to mistaken code generations, or due to compounding errors caused by the wrong values pushed to the memory banks, etc.)
Questions
See "weaknesses"
Rating
6: Weak Accept: Technically solid, moderate-to-high impact paper, with no major concerns with respect to evaluation, resources, reproducibility, ethical considerations.
Confidence
3: You are fairly confident in your assessment. It is possible that you did not understand some parts of the submission or that you are unfamiliar with some pieces of related work. Math/other details were not carefully checked.
Soundness
3 good
Presentation
3 good
Contribution
3 good
Limitations
Limitations are mostly sufficiently addressed. Another limitation to add is that the current approach is bottlenecked by the capabilities of LLMs and VLMs (e.g., SAMs) being used. Perception errors can occur due to the limited capabilities of current VLMs, and the ability to produce correct responses given more complex queries and more demanding tasks is bounded by the capabilities of current LLMs.
Summary
This paper presents a novel interface and deep-learning system that enables interactive animal behavioural analysis using only natural language, on tasks that previously required extensive coding expertise and technical machine learning knowledge. The proposed framework integrates various modules based on LLMs and existing vision networks dedicated to various parts of the task, such as understanding the data processing API and rephrasing user prompts. This work also contributes a novel long-short-term memory technique in the context of LLMs. In combination, the contributed interface and systems achieves state-of-the-art performance on established tasks in the domain of animal behavioural analysis, and has the potential to support domain experts in using neural techniques and software frameworks that are currently difficult for them to use.
Strengths
- Enables the novel user experience of analyzing animal behaviour using only natural language, which could be an important affordance for domain experts - Well-designed, workable end-to-end system that reasonably combines multiple deep-learning modules, all with dedicated purposes in various aspects of the task. - Effective use of SoTA techniques in deep learning to achieve high performance on established domain-specific tasks - Introduced a novel long-short-term memory module that is compatible with LLMs and shown effective usage of such module in the contributed framework
Weaknesses
- **Unclear general applicability of the long-short-term memory module and the framework in general:** From a machine learning perspective, the most significant technical contribution would be the long-short-term memory module in the context of LLM that the author(s) developed. The current paper discusses this module primary in the context of animal behavioural analysis. I would like to see some discussion of the general applicability of the memory module to common domains utilising LLMs, and also the general applicability of the entire framework to other domains, such that researchers working on those domains can benefit from the technical contributions of this paper. - **Unclear generalizability of the work due to author-crafted prompts:** This is a limitation the author(s) have acknowledged, such that the experiments performed by the author(s) all followed prompts crafted by the author(s). I also acknowledge that the author(s) have attempted to alleviate this issue by introducing OOD base questions and using similar task descriptions as the original definition in the MABE challenge. However, I am curious about the opinion of the end-user (i.e., animal behaviour analysts/specialists) on the ability of the system in handling their prompts. It would be great if the author(s) can include some study (could be formative/informal) and/or discussion regarding the ecological validity of the system. It would be great if the author(s) can report lower-level success metrics, such as the rate of having syntax/compilation errors of the analysis code generated by Amadeus. - **Limited technical novelty and contribution for Machine Learning**: Related to the first point, the primary technical contribution of the paper in terms of modelling techniques is the long-short-term memory module, which is limited. I believe more extensive discussion and/or experiments on this module could be helpful for researchers in the ML community to build upon the findings of this paper.
Questions
1) What are the general applicability of the long-short-term memory module and the entire framework to domains other than animal behaviour analysis? 2) Did any animal behaviour experts tried using the system / reviewed the prompts in the experiments of this paper? If so, what are their opinions on the ecological validity of them? 3) What is the more low-level success metrics of the code generated by the system, such as the compilation error rate?
Rating
5: Borderline accept: Technically solid paper where reasons to accept outweigh reasons to reject, e.g., limited evaluation. Please use sparingly.
Confidence
3: You are fairly confident in your assessment. It is possible that you did not understand some parts of the submission or that you are unfamiliar with some pieces of related work. Math/other details were not carefully checked.
Soundness
3 good
Presentation
4 excellent
Contribution
2 fair
Limitations
The limitations of this work were adequately discussed by the author(s).
Summary
This submission introduces a system, Amadeus, for performing behavioral analysis on animal videos. This system combines three elements: an API with descriptive docstrings for performing common behavioral analysis tasks, a modified version of GPT3.5 with an enhanced context window, and a prompt tuning of this GPT3.5 to allow for construction of task programs for behavioral analysis using a natural language interface. What is claimed is that (1) the language model can extend beyond its nominal 4096 character token window (2) the system allows for behavioral analysis with no additional code written (3) the system is easily extensible. The authors’ provide schematics of the system architecture and the integration between various components. There are numerous examples for how written code is produced from natural language. There are a few evaluations provided (1) comparing human raters and the amadeus system in computing time spent in arms of an elevated plus maze (2) comparing the performance of the system in a select number of tasks from the MABE challenge and (3) comparing the ability of a trained rephraser model to domain adapt queries to the developer’s syntactical patterns. There is a fairly comprehensive inclusion of the API in the appendix as well as examples of the rephraser module. Overall I found the contribution novel, of potential immediate utility to academic neuroscience labs performing behavioral analysis, and as an example for other groups hoping to automate analysis in other systems. I however found the evaluations and description of the methods somewhat lacking, and the generalizability and extensibility of the somewhat unclear. These would need to be improved for me to strongly endorse the paper.
Strengths
• This is the first LLM integration I have seen in the neuroscience and I think the approach is potentially interesting. In some ways I think it could be even more interesting for codebases that analyze on standardized experimental equipment (e.g. fluorescence imaging, neuropixels) because the set of tasks to perform is arguably more standardized than behavioral analysis, where the approaches, species, and questions can be fairly diverse. • Many researchers in the life sciences do not have a formal background in writing code or have to interact with a fairly specialized API to analyze data, and so assistance is useful here. • The system schematics and examples are clear. • The API documentation is helpful, and the integration of state of the art systems like SAM into an open-source (if this is to be distributed) codebase is helpful.
Weaknesses
• The manuscript is missing descriptions of the system architecture and training details. It is difficult to fully understand how the system was trained without this. • The evaluations are somewhat cursory. The results on the EPM are hard to evaluate because the ‘ground truth’ from the human raters is quite variable. The MABE evaluation is only presented across a subset of tasks. • The generalizability and extensibility of the system to new users and new behavioral tasks is unclear. Part of this is the rephraser example is somewhat limited, but it is also unclear how successful new users will be in writing functions with appropriate documentation and that documentation hints are not interdependent.
Questions
• Table 1 only lists a subset of MABE tasks, the model results should be reported across the full benchmark. • The lack of methods makes it difficult to know the details of the memory augmentation approach and the extent of training of the rephraser module (and how much one expects the later to generalize). • I found the memory augmentation result under-contextualized and other work in this space should be discussed. Augmenting LLM memory window is a subject under intense technological development and the contribution should be put into proper context, especially because it is a secondary result. • The EPM results are hard to evaluate because of inter-human variability. An experiment with clearer ground truth would help. • In general, hallucinations are a real problem for LLMs and I am not convinced by the given evaluations that they would not occur (e.g. for what fraction of a given call does the system produce the correct result). This is especially problematic for a system designed to be used by people who do not code and may not be able to debug problems. • The API is fairly expansive and includes example of most functions call and keyword arguments present in the given examples in the paper. This could mean that the system is limited in functionality to simply modifying parameters and numerical values given as input to the functions. Some statement about the expected generalization ability of the approach and the requirements for adding new functions to the docstring (e.g. does one have to provide examples of every new keyword input) is needed. • The claim that using the system would obviate the need to be able to code is strong. As the authors’ note, hallucinations are a problem for LLMs. Many in the field regard LLM solutions as an accelerated rough draft to be ‘fact-checked’ by a domain expert. Similar to the rephrasing analysis, it would be nice to have a statement about the reliability of the results, ideally across a pool of fairly naïve users.
Rating
5: Borderline accept: Technically solid paper where reasons to accept outweigh reasons to reject, e.g., limited evaluation. Please use sparingly.
Confidence
4: You are confident in your assessment, but not absolutely certain. It is unlikely, but not impossible, that you did not understand some parts of the submission or that you are unfamiliar with some pieces of related work.
Soundness
2 fair
Presentation
3 good
Contribution
3 good
Limitations
Yes
Reply
Thanks authors for the rebuttal! My concerns have been sufficiently addressed and I keep my original rating.
reply
I have read the rebuttal. I would like to maintain my initial rating. Good job.
Thank you for the author(s) detailed rebuttal and the extensive work in testing involving real expert users, which addressed some of my concerns. As a result, I raised my score from 4 to 5. I suggest the author(s) to include these changes in their revised paper, if accepted.
further questions
Thanks for some of these responses. I appreciate the contribution and the time but still have a few open questions that could influence my score: > From 362 queries 242 of which were from unique prompts (i.e., from user typed ones rather than executing the demos). 329 were automatically rephrased. We found Amadeus had reported 129 “errors”: 38 were caused by unsupported features or undefined variables, and were thus explained to the user, while 64 originated from programming errors. Therefore, from 362 queries there were an 18% programming error rate, and 11% unsupported feature requests rate. Can you clarify the 242 number and what fraction of errors came from manually typed prompts? Understanding what fraction of the 129 errors came from the demo prompts vs. manually generated could substantially change the interpretation. > • The manuscript is missing descriptions of the system architecture and training details. It is difficult to fully understand how the system was trained without this. Are you planning on including details about the training procedure and more methodological descriptions of the networks used? > EPM, and mouse behavior in general, is somewhat subjective, hence the absolute ground truth is a mixture of experts this is a minor point. FIgure 4 a.1 is confusingly oriented such that the variance presented is across videos/trials which obscures any potential differences across humans and amadeus. For quantitative data its a very qualitative and anecdotal result of 'they are in a similar ballmark', but only using 5 trials and plotting the data to maximize trial to trial variance is a fairly poor way of comparing these.
>Can you clarify the 242 number and what fraction of errors came from manually typed prompts? Understanding what fraction of the 129 errors came from the demo prompts vs. manually generated could substantially change the interpretation. Yes, sorry for any confusion! None of the 242 were manually typed, these were all new, naive user inputs (from alpha testers). If we used GPT3.5 it was 18% overall (therefore 26% of the 242, 18% of the 362). Critically, we **also tested 10 failed runs from users (that used GPT3.5) and re-ran the prompts with GPT4, now only 3 failed.** Thus, this would be an 11% effective overall error rate. Here are examples of the 10 that previously failed with GPT3.5, where now only 3 fail: 1: ['❌ Get angles and distances between all body parts. Plot a UMAP graph using the resulting data.', 2: '✅ Perform hierarchical clustering and plot the dots with different colors based on their clusters.', 3: '✅ Plot the distance between animals over time.', 4: '✅ What is the speed of the changes from the left to the right arm?', 5: '✅ Define <|relative_head_angle|> as the angle between the mouse_center and the head_midpoint. Plot the variation of <|relative_head_angle|> over time.', 6: '❌ Plot animal center of mass x-coordinate, velocity, acceleration, and head direction.', 7; '✅ Plot a bar graph with the first bar representing the total time the animal spends in ROI0 (open arm) and the second bar representing the total time the animal spends outside of ROI0 (closed arm).', 8: '✅ Plot the euclidean distance between the nose points of animal0 and animal2 over time.', 9; '❌ Define <|head_direction|> as the orthogonal angle to the line between left_ear and right_ear.', 10: '✅ Plot each grooming bout.', **We will absolutely add this new analysis to manuscript 😃!** > • The manuscript is missing descriptions of the system architecture and training details. It is difficult to fully understand how the system was trained without this. > Are you planning on including details about the training procedure and more methodological descriptions of the networks used? **Yes, of course we will add methodological details** about the networks and what we added in the first rebuttal, namely we did not train GPT3.5 or GPT4 ourselves, we rely on openAI API calls. Apologies if that was not clear in our first rebuttal: "(1) We do not fine-tune GPT3.5 (or GPT4) or the segmentation (SAM) or pose estimation models (SuperAnimal). Our system consists of three GPT3.5 instances with different system prompts, the pre-trained computer vision models, and our API implementation, we will clarify in revision. Re: system architecture, we hope Figure 2 gives a comprehensive design of the system, and more details about API design and system prompt design are provided in Appendix." Just to add, one feature we want to highlight is one can think of Amadeus like a front end to foundational LLMs and computer vision models that allow for customized APIs plus our new dual-memory system that requires no fine-tuning or vector database. Our rebuttal point 3 to reviewer ZigY might also be of interest on this latter point. > "EPM, and mouse behavior in general, is somewhat subjective, hence the absolute ground truth is a mixture of experts" > - this is a minor point. FIgure 4 a.1 is confusingly oriented such that the variance presented is across videos/trials which obscures any potential differences across humans and amadeus. For quantitative data its a very qualitative and anecdotal result of 'they are in a similar ballmark', but only using 5 trials and plotting the data to maximize trial to trial variance is a fairly poor way of comparing these. We apologize for any confusion here. What **we aimed to show is the same plot style as in the original benchmark paper** (see panel f here: https://www.nature.com/articles/s41386-020-0776-y/figures/4) Namely, those authors show that between 3 human raters they counted similar, but not the identical number of head-dips across 5 different long videos (not 5 trials) of mice. Each dot denotes a different mouse video). What we are trying to show, for example, is that all humans have the lowest count for the yellow mouse, as does Amadeus. All humans have the highest count for blue mouse, so does Amadeus. **We can happily modify the figure to connect the dots across humans and Amadeus to make that more obvious, thank you for the great suggestion.** We hope that clarifies your open questions and you'd consider supporting our paper. Thanks again for your time.
Apologies in advance to bother you, but given today is the last period of rebuttal clarifications, we want to be sure you saw our last response.
Apologies in advance to bother you, but given today is the last period of rebuttal clarifications, we want to be sure you saw our rebuttal. Thank you!
Decision
Accept (poster)