Table of Contents
Fetching ...

ChainForge: A Visual Toolkit for Prompt Engineering and LLM Hypothesis Testing

Ian Arawjo, Chelse Swoopes, Priyan Vaithilingam, Martin Wattenberg, Elena Glassman

TL;DR

ChainForge addresses the challenge of understanding LLM behavior beyond single prompts by delivering an open-source, visual toolkit for on-demand hypothesis testing. The system supports model selection, prompt template design, and systematic evaluation with combinatorial prompting and prompt chaining, enabling side-by-side cross-LLM comparisons and interpretable visualization of outputs. Through in-lab and real-world studies, the authors identify three usage modes—opportunistic exploration, limited evaluation, and iterative refinement—and demonstrate that users repurpose ChainForge for tasks such as prototyping data processing pipelines and sharing results. The work contributes a novel Prompt Node, Response Inspector, and data-flow architecture for LLM evaluation, with practical implications for broader LLMOps tooling and open-source collaboration.

Abstract

Evaluating outputs of large language models (LLMs) is challenging, requiring making -- and making sense of -- many responses. Yet tools that go beyond basic prompting tend to require knowledge of programming APIs, focus on narrow domains, or are closed-source. We present ChainForge, an open-source visual toolkit for prompt engineering and on-demand hypothesis testing of text generation LLMs. ChainForge provides a graphical interface for comparison of responses across models and prompt variations. Our system was designed to support three tasks: model selection, prompt template design, and hypothesis testing (e.g., auditing). We released ChainForge early in its development and iterated on its design with academics and online users. Through in-lab and interview studies, we find that a range of people could use ChainForge to investigate hypotheses that matter to them, including in real-world settings. We identify three modes of prompt engineering and LLM hypothesis testing: opportunistic exploration, limited evaluation, and iterative refinement.

ChainForge: A Visual Toolkit for Prompt Engineering and LLM Hypothesis Testing

TL;DR

ChainForge addresses the challenge of understanding LLM behavior beyond single prompts by delivering an open-source, visual toolkit for on-demand hypothesis testing. The system supports model selection, prompt template design, and systematic evaluation with combinatorial prompting and prompt chaining, enabling side-by-side cross-LLM comparisons and interpretable visualization of outputs. Through in-lab and real-world studies, the authors identify three usage modes—opportunistic exploration, limited evaluation, and iterative refinement—and demonstrate that users repurpose ChainForge for tasks such as prototyping data processing pipelines and sharing results. The work contributes a novel Prompt Node, Response Inspector, and data-flow architecture for LLM evaluation, with practical implications for broader LLMOps tooling and open-source collaboration.

Abstract

Evaluating outputs of large language models (LLMs) is challenging, requiring making -- and making sense of -- many responses. Yet tools that go beyond basic prompting tend to require knowledge of programming APIs, focus on narrow domains, or are closed-source. We present ChainForge, an open-source visual toolkit for prompt engineering and on-demand hypothesis testing of text generation LLMs. ChainForge provides a graphical interface for comparison of responses across models and prompt variations. Our system was designed to support three tasks: model selection, prompt template design, and hypothesis testing (e.g., auditing). We released ChainForge early in its development and iterated on its design with academics and online users. Through in-lab and interview studies, we find that a range of people could use ChainForge to investigate hypotheses that matter to them, including in real-world settings. We identify three modes of prompt engineering and LLM hypothesis testing: opportunistic exploration, limited evaluation, and iterative refinement.
Paper Structure (27 sections, 1 equation, 6 figures, 3 tables)

This paper contains 27 sections, 1 equation, 6 figures, 3 tables.

Figures (6)

  • Figure 1: The emerging space of tools for LLM operations
  • Figure 2: An example of chaining prompt templates, one of ChainForge's unique features. Users can test different templates at once by using the same input variable (in {} brackets). Templates can be chained at arbitrary depth using TextFields nodes. The user is hovering over the Run button of the Prompt Node, displaying a reactive tooltip of how many queries will be sent off.
  • Figure 3: (A) The Response Inspector in Grouped List layout, showing four LLMs' responses side-by-side to the same prompt. Each color represents a different LLM, named in each box's top-right corner. Here the user requested has $n=2$ responses per prompt, and has grouped responses by prompt variables command and then input. (B) Users can click on groupings (blue headers) to expand/collapse them. (C) An alternative Table Layout offers a grid for interactive comparison across prompt variables and models, where users can change the main column-plotted variable. Users can also export data to a spreadsheet (not shown). Interactive version at https://chainforge.ai/play
  • Figure 4: A more complex example, depicting a ground truth evaluation using Tabular Data (A), TextFields (B), and Simple Evaluator (C) nodes. User has plotted scores (D) by a prompt variable command to compare prompts, finding that Claude and Falcon.7B do slightly better on their second prompt. User can then go back to (B) or (A), iterating on prompts or input data, and re-run prompt and evaluator nodes; ChainForge only sends off queries it has not already collected.
  • Figure 5: P17 plots the response lengths of three command prompts, augmenting her theories about each prompts' performance.
  • ...and 1 more figures