mlsanityData to 7 Oct 2026

Evaluating In-Context Learning of Libraries for Code Generation

arXiv 2311.09635 ↗First posted 16 Nov 2023cs.CLcited by 3

Not on the map. Why?

Abstract (arXiv)

Contemporary Large Language Models (LLMs) exhibit a high degree of code generation and comprehension capability. A particularly promising area is their ability to interpret code modules from unfamiliar libraries for solving user-instructed tasks. Recent work has shown that large proprietary LLMs can learn novel library usage in-context from demonstrations. These results raise several open questions: whether demonstrations of library usage is required, whether smaller (and more open) models also possess such capabilities, etc. In this work, we take a broader approach by systematically evaluating a diverse array of LLMs across three scenarios reflecting varying levels of domain specialization to understand their abilities and limitations in generating code based on libraries defined in-context. Our results show that even smaller open-source LLMs like Llama-2 and StarCoder demonstrate an adept understanding of novel code libraries based on specification presented in-context. Our findings further reveal that LLMs exhibit a surprisingly high proficiency in learning novel library modules even when provided with just natural language descriptions or raw code implementations of the functions, which are often cheaper to obtain than demonstrations. Overall, our results pave the way for harnessing LLMs in more adaptable and dynamic coding environments.

Key facts. Cited by 3 papers in the map (data through 7 Oct 2026). Builds on 24 of its 43 references that are in the map. First posted on arXiv 16 Nov 2023.

Builds on

24 of 43 references.

References · 24

  1. 2023GPT-4 Technical Reportcited by 18,132
  2. 2022Training language models to follow instructions with human feedbackcited by 15,712
  3. 2023Llama 2: Open Foundation and Fine-Tuned Chat Modelscited by 12,865
  4. 2021Evaluating Large Language Models Trained on Codecited by 8,053
  5. 2021Measuring Mathematical Problem Solving With the MATH Datasetcited by 5,203
  6. 2023Toolformer: Language Models Can Teach Themselves to Use Toolscited by 4,072
  7. 2021Program Synthesis with Large Language Modelscited by 3,509
  8. 2023Code Llama: Open Foundation Models for Codecited by 2,105
  9. 2023ToolLLM: Facilitating Large Language Models to Master 16000+ Real-world APIscited by 1,880
  10. 2023Gorilla: Large Language Model Connected with Massive APIscited by 1,302
  11. 2022Code as Policies: Language Model Programs for Embodied Controlcited by 1,172
  12. 2023StarCoder: may the source be with you!cited by 790
12 more
  1. 2023API-Bank: A Comprehensive Benchmark for Tool-Augmented LLMscited by 574
  2. 2022DS-1000: A Natural and Reliable Benchmark for Data Science Code Generationcited by 442
  3. 2023ToolAlpaca: Generalized Tool Learning for Language Models with 3000 Simulated Casescited by 383
  4. 2023Chameleon: Plug-and-Play Compositional Reasoning with Large Language Modelscited by 352
  5. 2023ToolQA: A Dataset for LLM Question Answering with External Toolscited by 273
  6. 2023ART: Automatic multi-step reasoning and tool-use for large language modelscited by 193
  7. 2023On the Tool Manipulation Capability of Open-source Large Language Modelscited by 122
  8. 2022Evaluating the Text-to-SQL Capabilities of Large Language Modelscited by 101
  9. 2023Tool Documentation Enables Zero-Shot Tool-Usage with Large Language Modelscited by 66
  10. 2023Grammar Prompting for Domain-Specific Language Generation with Large Language Modelscited by 58
  11. 2023Skills-in-Context Prompting: Unlocking Compositionality in Large Language Modelscited by 33
  12. 2023MAGNIFICo: Evaluating the In-Context Learning Ability of Large Language Models to Generalize to Novel Interpretationscited by 7

Built on by

Cited by year

Citing papers per year: 2024: 1; 2025: 2.

3 papers.