How to vibe code in science: early adopters share their tips
-
-
Bluesky
-
-
-
-
-
X
Illustration by Paweł Jońca
Last year, climate researcher Zeke Hausfather was playing around with climate-data visualizations, trying to find new and shocking ways to show just how fast Earth is warming. He was brainstorming ideas with an artificial-intelligence tool and getting it to code and create them quickly. Together, they made innovative tree-ring-style plots with the months of the year around each ring, the annual circles growing outwards with time and the colours showing temperature. Then Hausfather asked the AI tool: what if these plots were 3D?
The result was what Hausfather calls a thermal helix animation, showing temperature spiralling upwards through time into a shape reminiscent of a tornado (see ‘A new view’). In a world in which most people have seen the classic ‘hockey-stick’ graph of rising global temperatures, it is a refreshing graphic: compelling and beautiful. And, despite being a competent coder, Hausfather had no idea how to make it on his own.
Hausfather, a researcher at the climate data non-profit organization Berkeley Earth in California, is not alone in using AI tools in this way. Thanks to large language models (LLMs), people can now simply ask their computers to write and implement code for graphics, applications, data processing and just about anything else they can imagine.
This kind of laid-back, conversational technique is often called vibe coding. Andrej Karpathy, co-founder of US firm OpenAI, coined the term last year. It refers to asking an LLM-powered tool to build or do something with code behind it, with the user providing clarifying prompts until the results look right. At its purest, vibe coding doesn’t involve looking at the code — just the product. But the term has no strict definition, so what counts as vibe coding is fuzzy. Plenty of people with coding know-how start a project by vibing and then check the code by hand, or start coding by themselves and then ask an AI tool to fill in the gaps.
Credit: Zeke Hausfather
Nature spoke to a variety of scientists, from highly adept coders to complete beginners, and those in the middle, such as Hausfather, who are using AI to stretch the limits of what they can do. Many use AI-assisted coding in their work, and some are intentionally testing its limits. All of them said the AI tools that are already out there are impressive, helping them to drastically speed up their work or try out fresh ideas. But they also warn that the tools should be used with caution, and some had scary stories to tell.
All aboard
In some ways, vibe coding is the culmination of a long evolution of computer interfaces. In the 1960s, people used punch cards to communicate with machines. Computer scientists soon developed coding languages — such as BASIC and later Python — which made giving instructions to computers more natural. And developers made software systems so that non-coders could create with aplomb in limited contexts: Microsoft Word, for example, lets users make formatting changes to documents without knowing how to code. What’s new is the unparalleled speed and versatility that LLMs bring to generating code, alongside their quirky tendency to make things up and get things wrong.
What are the best AI tools for research? Nature’s guide