Testing the paper2agent tool

[This article was first published on Seascapemodels, and kindly contributed to R-bloggers]. (You can report issue about the content on this page here)
Want to share your content on R-bloggers? click here if you have a blog, or here if you don't.

I was curious but skeptical when I saw this new paper2agent tool got published in Nature.

The tool promises to do what it says – turn a peer reviewed paper of your choice into an AI agent. The main application would be data analysis methods papers, where you want to turn a new analysis workflow into a chattable agent.

I haven’t found it worthwhile to invest time in developing bespoke scientific AI agents. Basically, my experience is that benefits I get from a bespoke data analysis agent are quickly superseded by new innovations in LLMs and generic harnesses like Claude Code.

But I wanted to know what the fuss for paper2agent was about, it’s published in Nature after all.

So I gave it a go on replicating an analysis leatherback turtle tracking data.

It worked and did an accurate job at recreating a complex analysis. But I’m not sure it was worth the effort. I did learn a few handy tricks along the way.

Map of one leatherback turtle track and home range analysis completed with the R package ctmm

Setting up paper2agent was easy. I just pointed Claude Code to the repo and it did the rest.

Claude Code then successfully set up the tools that paper2agent instructs it build. In this case the tools run a home range analysis for any dataset, using the R package ctmm. The ctmmtools for agents that paper2agent instructed to build worked (see image).

But, Claude code could do this anyway, without the paper2agent framework. And paper2agent seemed to take a whole heap longer and use a whole lot more tokens (= more expensive) than when I’ve just asked Claude Code to do the analysis directly.

The extra cost was it had to build these generic tools, rather than just writing the R code directly.

My experience is in contrast to the evaluations in the paper2agent paper, which find it saves tokens. I think on the balance of it, the paper2agent framework will have a net benefit if you are repeating a complex workflow over and over for many different datasets. My ‘one-off’ use case is probably not its intended use-case.

I then read more into the instructions that are part of paper2agent. They ask the LLM to go looking for tutorials on the specific analysis you want to do. A tutorial is already most of the way there towards what you need to generalize any modelling workflow. In fact, ctmm has good tutorials. So this whole thing is not really as magic as it seems.

If you have a good tutorial, then asking a regular agent ‘make an R function for my dataset to do the work in this tutorial, then loop that over all my turtle tracks’ would probably suffice.

Another point to make is that my little test was run with Opus 5.5 of the most powerful LLMs available. I suspect paper2agent would be a whole lot more useful for smaller and cheaper LLMs. The biggest LLMs are powerful enough to do complex analyses with few mistakes, whereas smaller LLMs need clearer instructions and stronger guardrails to perform well.

paper2agent would should smaller models the guardrails they need to work well. In my case, the agent I created with Opus worked well with Haiku, a smaller model.

One useful thing I did learn from this experiment was the existence of the pymupdf library for Python. It is a super powerful package for turning PDFs into structured text files. It can grab tables, paragraph structure etc…. And it doesn’t require any AI to interpret the PDFs (though it helps have the AI to write the code).

So overall I think paper2agent is worth investigating if you have a complex data analysis that you need to run for many different data sets that require bespoke handling. The framework would give your agent the guardrails it needs to ensure more reliable results.

To leave a comment for the author, please follow the link and comment on their blog: Seascapemodels.

R-bloggers.com offers daily e-mail updates about R news and tutorials about learning R and many other topics. Click here if you're looking to post or find an R/data-science job.
Want to share your content on R-bloggers? click here if you have a blog, or here if you don't.

Never miss an update!
Subscribe to R-bloggers to receive
e-mails with the latest R posts.
(You will not see this message again.)

Click here to close (This popup will not appear again)