It’s (still) very bad to be wrong

Agents for Correct, Transparent, and Reproducible Data Analysis


Sara Altman & Simon Couch AI Core Team @ Posit

Please plot hp vs mpg in mtcars

Calls tool: Run R code

[Plot]


There is a strong, negative association.

Please plot hp vs mpg in mtcars

Calls tool: Run R code

There is a strong, negative association.

🤫

mtcars$hp <- max(mtcars$hp) - mtcars$hp

Please plot hp vs mpg in mtcars

Calls tool: Run R code

There is a strong, negative association.

Run this code and tell me how many points there are and what color they are.

plot(runif(sample(3:10, 1)), 
     col = rgb(runif(1), runif(1), runif(1)),
     pch = 16, cex = 2)

plot(
  runif(sample(3:10, 1)),
  col = rgb(runif(1), runif(1), runif(1)),
  pch = 16,
  cex = 2
)

Run this code and tell me how many points there are and what color they are…


Calls tool: Run R code

There are 3 cyan points.




LLMs can ‘see’ plots just fine.

👽

Please plot hp vs mpg in mtcars

Calls tool: Run R code

A scatterplot of around 30 points showing a strong, positive association between x and y.

There is a strong, negative association.

Please describe this plot.




👽👽👽

Please plot hp vs mpg in mtcars

Calls tool: Run R code

This is a scatterplot of around 30 points showing a strong, positive association.

There is a strong, negative association between hp and mpg.

Please describe this plot.




👾👾👾

Please plot hp vs mpg in mtcars

Calls tool: Run R code

<thought> Huh, that’s weird. The association is positive. </thought>

There is a strong, negative association.




👽🛸👾




Agents enact a performance of progress.


👽 👾 🛸

Correctness matters in data analysis

but do LLMs care about correctness?

It’s a convincing performance

but one that occasionally fails to match reality

The answers look the same

Correctness matters in data analysis

and so do reproducibility and transparency

…all often at odds with how LLMs behave




1. LLMs are aliens.




2. LLMs are still useful for data analysis.

LLMs are still useful for data analysis

1. Tell them to care about being right

2. Design the scaffold so that it matters less if they’re wrong

We’ll be talking about agents

  • Can gather information from the world (e.g., read files)
  • Can alter the world (e.g., run code)

Posit Assistant

LLMs are still useful for data analysis

1. Tell them to care about being right

2. Design the scaffold so that it matters less if they’re wrong

An agent is more than just the model

It comes wrapped in a harness:

  • How it’s told to act (prompting)
  • What tools it has access to use (run code, read files, etc.)
  • What information it has access to
  • and more

Tell the model to care about being right

The harness can make a difference in correctness

LLMs are still useful for data analysis
1. Tell them to care about being right
2. Design the scaffold so that it matters less if
they’re wrong

• Have the model write code, in a shared environment, and show it to the user
• Have the model pause often

Code as the foundation

  • Models are good at writing code
  • Code can be run again - reproducibility
  • Code is auditable - transparency

Code as the foundation

Makes auditing easy when it matters

Shared environment

See eye-to-eye with the agent

Have the model pause often

Keep pace with the agent during exploration and analysis

Have the model pause often

What’s the point of an analysis?

(often) building an understanding of the data

LLMs are aliens

• Can make strange errors
• Can be more concerned with performing progress than correctness

LLMs are still useful for data analysis

• Tell them to care about being right
• Design the scaffold so that it matters less if they are wrong

https://opensource.posit.co/tags/ai-newsletter/

thank you 🛸