StudentEval: A Benchmark of Student-Written Prompts for Large Language Models of Code

Hannah McLean Babe, Sydney Nguyen, Yangtian Zi, Arjun Guha, Molly Q. Feldman, Carolyn Jane Anderson

Introduction

Large Language Models (LLMs) for code are frequently promoted as a means to "democratize" programming, enabling non-experts to translate natural language ideas into functional code. However, existing benchmarks like HumanEval or MBPP primarily rely on expert-crafted prompts. These prompts are characterized by technical precision, correct vocabulary, and singular, idealized descriptions. This creates an evaluation gap: in practice, novices often use ambiguous language, technical inaccuracies, and iterative strategies that models may not be prepared to handle.

StudentEval addresses this gap by replacing expert prompts with 1,749 natural language descriptions authored by 80 beginner programmers. This benchmark captures the linguistic variety and messy reality of how non-experts actually interact with code LLMs, providing a more realistic test of a model’s utility for the general public.

Methodology

The researchers recruited 80 undergraduate students who had completed a single introductory Python course. These students were tasked with writing prompts for 48 beginner-level Python problems, such as calculating factorials or manipulating lists.

The collection process utilized a human-in-the-loop platform. Students wrote a prompt, observed the LLM-generated code (using Codex), and checked the output against expert-written test cases. They were encouraged to iterate on their prompts until they achieved success or chose to stop. This iterative process allowed the researchers to categorize prompts into four distinct subsets: First Failure, First Success, Last Failure, and Last Success. Models were then evaluated using the pass@1 metric—the probability of generating a correct solution in a single attempt.

Dataset Characteristics

The resulting StudentEval dataset contains 1,749 prompts across 48 problems, averaging 36 unique prompts per problem. This diversity is crucial for statistical analysis of prompt efficacy and model robustness.

Figure 1: Distribution of student submissions across the 48 problems, categorized by success and order of attempt.

As shown in Figure 1, the number of submissions varied significantly by problem, reflecting different levels of difficulty and the iterative nature of student prompting. The categorization into first/last success/failure allows for nuanced evaluation of how models handle both "lucky" first attempts and heavily refined technical descriptions.

Results and Analysis

The study reveals that StudentEval is a significantly more challenging benchmark than HumanEval. Models that appear comparable on expert prompts often show massive performance gaps when faced with student-written language.

Model Performance and the Complexity Gap

Code Llama-Py-34B emerged as the top performer, particularly on the "Success" subsets. Larger models demonstrated a clear advantage in robustness; for instance, on the Last Success subset, the 34B Code Llama model was nearly four times more effective than the 1B StarCoderBase model. This suggests that model scale is a critical factor in handling the "noisy" or non-standard language typical of novices.

Figure 2: Cumulative distribution of pass@1 scores for Code-Llama-Py-34B across the four prompt categories.

Figure 2 illustrates the performance of the 34B Code Llama model. While it performs well on prompts that students eventually succeeded with (the green lines), there remains a significant portion of problems where even the best prompts resulted in low pass@1 scores, highlighting the inherent difficulty of non-expert communication.

Linguistic Sensitivities

The analysis identified several key factors influencing success:

  • The "Return" Trap: A common failure mode was the ambiguity between "printing" and "returning" values. Prompts explicitly using the word "return" saw a significant success boost.
  • Vocabulary Sensitivity: Models favored Python-specific terms (e.g., "list") over general computer science terms (e.g., "array"), indicating an alignment with specific documentation styles.
  • Prompt Length: Successful student prompts tended to be longer and more descriptive, contradicting common advice to be concise.

Conclusion

StudentEval highlights the limitations of current code LLMs when prompted by non-experts. While larger models show promise in bridging the gap, the sensitivity to specific terminology and the "illusion of success" (where a lucky first attempt masks a low-probability prompt) present significant hurdles for true democratization. Future work should explore expanding this benchmark to other languages and developing LLMs that can actively assist students in refining their technical descriptions.

Summary updated

BibTeX
@inproceedings{babe2024studenteval,
  author = {Hannah McLean Babe and Sydney Nguyen and Yangtian Zi and Arjun Guha and Molly Q. Feldman and Carolyn Jane Anderson},
  title = {{StudentEval: A Benchmark of Student-Written Prompts for Large Language Models of Code}},
  booktitle = {Annual Meeting of the Association for Computational Linguistics},
  year = {2024},
  doi = {10.18653/v1/2024.findings-acl.501},
}
Figure