Manuscript Offprint

arXiv:2611.22905

Think Before You Code: A Benchmark for Testing LLMs on Software Engineering Deliberation

Ashman Mehra

Open access. PaperVantage converted this article to text, so layout and figures may differ from the original.

Abstract

Think Before You Code (TBYC) is a benchmark pipeline for studying whether code-focused language models can reason about software issues in ways that resemble human engineering deliberation. The benchmark curates GitHub issue discussions into structured records, extracts human discussion artifacts such as problems, solutions, constraints, rationales, and trade-offs, and then prompts models to generate issue-level “thoughts” using retrieved code context and few-shot examples. It converts model responses back into the same artifact space and evaluates them against human annotations using complementary metrics for artifact type detection, metadata matching, tag overlap, and semantic summary similarity. Beyond scoring, this project includes visualization, leaderboard, and baseline tools that make it possible to compare models, prompting strategies, and extraction methods across repositories and issues. Think Before You Code is an end-to-end evaluation environment for measuring how closely LLM software reasoning aligns with human strategic judgment.

CODE FOR THE PROJECT CAN BE FOUND HERE - ashman17/ThinkBeforeYouCode

1 Introduction

This project addresses the use case of evaluating whether code LLMs can do more than generating plausible code and instead reason through software engineering problems the way human developers do. In real development, strong performance depends on understanding bug reports, surfacing constraints, weighing trade-offs, asking clarifying questions, using code context, and proposing grounded next steps. Think Before You Code (TBYC) turns that broader reasoning process into something measurable by building a pipeline from GitHub issue discussions to structured human reasoning artifacts, then comparing model behavior against those artifacts. The intended downstream users are researchers and practitioners who want to benchmark coding models not just on final answers, but on the quality of their intermediate engineering judgment.

The main research questions are (modified from the proposal):

  1. Can code LLMs reconstruct the kinds of reasoning humans express in issue discussions?
  2. How much does retrieved code context help compared with no-context, BM25-only, or few-shot baselines?
  3. Which parts of human reasoning are easiest or hardest for models to match, such as identifying artifact types, preserving metadata, assigning tags, or producing semantically aligned summaries?

This research project studies these questions by extracting human artifacts from discussions, generating model “issue thoughts,” re-extracting comparable artifacts from model outputs, and scoring agreement with a suite of metrics and visualizations.

Users interact with the application primarily through the CLI pipeline. They can fetch and normalize GitHub issues, extract human discussion artifacts, retrieve relevant code chunks, run different reasoning-generation settings, derive comparable artifacts from model outputs, compute metrics, and generate graphs, leaderboards, and an HTML viewer. In that sense, the application behaves like an end-to-end research workbench rather than a consumer-facing product: the user supplies repositories and models, and the system produces structured benchmark outputs for analysis and comparison.

The project engages with course material in several direct ways. It connects to code-writing assistants by focusing on software reasoning rather than raw code completion, and it uses the science of prompting through structured prompts for both artifact extraction and issue-thought generation. It draws on learning representations and embeddings, retrieval, and retrieval-augmented generation through CodeBERT embeddings, BM25, FAISS indexing, and hybrid code-context retrieval. It also engages LLMs for evaluation by using model outputs as analyzable artifacts and scoring them against human annotations, while raising questions related to deployment and harms - a coding assistant that sounds confident but misses human constraints or trade-offs can still be unreliable in practice.

References (10)