Follow on LinkedIn ← Back to home

Effective and cautious use of AI for research: How I solved two PhD-level problems in 15 days using a human–AI collaborative framework

Ankur Gupta

I used Claude Code to solve two PhD-level problems in theoretical multiphysics in 15 days, using a human–AI collaborative framework. The human controls every decision and the process; the AI accelerates the execution. This post covers how the framework works, and why preparation and being organized matter more when the tool is this easy to use. It also covers that while AI can answer these applied maths questions quickly, parsing through the solutions can be quite challenging. Finally, it covers what the new results are, why rigor in training matters more and not less, and what the future of research might look like.

In April this year, my student Arkava Ganguly and I used Claude to help solve a scientific problem we had been working on for about a year and a half. With AI assistance, we reached a result in five weeks. I wrote up that experience in an earlier post, and the paper is now out in the Journal of Fluid Mechanics. However, we started the problem without much of a plan, and the calculations went in many directions. Furthermore, AI made mistakes that became difficult to catch. I wanted to check if we could come up with a systematic method to reduce errors, without offloading the cognitive work to AI, and while keeping the results accessible to humans. To do so, I solved two PhD-level problems in 15 days using AI and documented everything transparently. The results are detailed in the pre-print, including prompts and figures.

For transparency, the whole project consumed about 68 million tokens, which would cost roughly $2,100 at Claude Opus 5 API rates, counting the cached context that is re-read on every request; I was on a subscription plan and was not billed per token. I spent about 80 hours of personal time on this project, finding time over the whole two weeks whenever possible.

The process is the focus of this post, though the results might also be interesting to some readers. I have kept the scientific results brief and interactive; the full details, along with the original prompts and the session records, are in the pre-print.

How to effectively and cautiously use AI?

I used Claude Code throughout the project. If you have never used Claude Code (or Codex), I recommend checking it out. Instead of a chatbot, it reads the files stored locally on your computer and can edit and create files directly in the folder. My typical workflow using Claude Code is shown below. I use it to read text files and PDFs, and I ask it to create Python scripts, derivation documents, schematics and figures.

A Claude Code session on the diffusiophoresis problem: the sessions are listed on the left, one per task, and the reply to a question about how our coefficients line up with the ones in the literature is on the right.
A Claude Code session on the diffusiophoresis problem. The sessions are listed on the left, one per task; on the right is the reply to a question I asked about how our coefficients line up with the ones already in the literature. Click to enlarge.

Some challenges of doing research using AI tools:

  1. Given how easy it is to use AI tools, it is common to just start asking questions and then veer off into directions and ideas that can be difficult to come back from. The ease of these tools reduces the tendency to do the prep work: to be organized and to make a plan in advance.
  2. If you give it too much autonomy, it can come up with a plausible-sounding result where the steps and reasoning are not explicitly laid out. This can make it difficult to check its work.
  3. If you keep going in a single session, it starts to drift because of context overloading.
  4. It does not do maths and reasoning like humans. Therefore, if you just look at a final result, it might not make a lot of sense.

To circumvent these challenges, I suggest a framework explained in the image below. The framework proposes being more organized and emphasizes that preparation and understanding are prerequisites. This framework is not totally new. It was partly inspired by an earlier blog from a different field.

Honesty rules fixed before the first session, re-read at the start of every new one • Show every step; never skip one with “it follows that” • Never tune a parameter or a fit to make things match • Never make a discrepancy smaller than it is • Name every term dropped, and the limit that was taken • If a known limit is not recovered, say so • Report failures, and uncertainty, plainly decisions do not cross this line YOU every decision AI every execution 1. Frame the problem Pick the few key papers. Write the equations and the boundary conditions yourself. 2. Set the tasks, and their checks Every check is fixed before the derivation it will judge exists. A check written after you have seen the answer is not evidence. 3. Ask for the limits, then judge Ask what was dropped and in what order the limits were taken. Then approve, send back, or kill it. Nothing enters the record unsigned. 1. Derive, solve, compute One task per session, reading only the approved summary of the sessions before it. 2. Run the checks The check it was given, and any of its own. Report every term it dropped, and say plainly when the check did not pass. 3. Draft the result and the record Update the task list, the summary and the log of corrections. All are drafted as proposals, never written in as entries. one task = one session drafts, for sign-off cleared tasks, then the write-up next task

The key elements of the above are:

1. Set “honesty” rules. These are base rules and could be (i) never fit a parameter without asking, (ii) never make a discrepancy smaller, (iii) never skip a mathematical step, and so on. You can set rules appropriate for your project. They live in a file that is read at the start of every session.

2. Choose a specific approach. The idea is not to only ask it for a result, but to guide it so that it follows your path of calculation. For instance, if you are building off a paper, understand these papers in-depth. Then ask the tool to extend them the way you want it. For instance, in my case it looked like (DP below refers to the diffusiophoresis problem and BPM refers to the bipolar membrane problem; they are detailed later):

DP“Go to 1-diffusiophoresis folder and read the document at relevant publications/2024_GangulyRoychowdhuryGupta_JFM.pdf. Specifically, I want you to go through section 3.3 carefully and understand the governing equations and boundary conditions. Then, I want you to reproduce the derivation and the numerical results in Fig. 3.”

BPM“Go to the 2-bipolar-membranes folder and read the document in relevant publications/2023_ParnamaePorada_EST. Specifically, I want you to go through the section ‘Theory of Ion Transport in Bipolar Membranes’ carefully and understand the governing equations and boundary conditions. There are many inline equations, and they can be hard to follow since they aren’t laid out in a pedagogical fashion. Be very careful when you read these.”

3. Use one session per task. Do not use one session to do all the tasks; keep to one task per session. In one of my prior projects, I had a very long conversation where the session started losing context and started making basic mistakes, such as getting the names of the files wrong. Avoid this. Keep one specific task per session. One might wonder — what is a “task”? There is not a clear line, but a good rule of thumb is that a task is one step in a larger objective. Examples could be (i) write down the governing equations and boundary conditions, (ii) solve and plot the concentration against the $x$ coordinate, or (iii) analyse a plot from the paper, extract the data, take the square root of the $y$-axis values and replot them against $x$. If you combine too many steps into one task, you might be handing over too much autonomy to the tool. If you break them up too finely, you may not be efficient. I lean towards breaking them up more than feels necessary, just to reduce the chances of error propagation, but my best guess is that one gets better at setting this with time. Two of the tasks from this project, one from each problem:

DP“Digitize JFM figure 3(a) and 3(b) from the PDF page image; overlay our numerics; produce the figure with shared/softmatter.mplstyle + shared/plotstyle.py.”

BPM“Close the problem: state the computational domain, the full boundary-condition set at the three interfaces, what fixes the junction, how $V_{\rm bpm}$ is assembled, and which quantity is the control variable. Count unknowns against equations and show the problem is well posed.”

4. Regular checks are critical. Whenever possible, fix checks in advance. This helps ensure that the calculation is not going in an unanticipated direction. You may add more checks along the way. Some examples of my checks include — note the specificity:

DP“Check for task 1: A one-to-one match with the results presented in Fig. 3. Also, ensure that all other equations are recovered correctly.”

DP“Check for task-4: Reduce to binary electrolyte result. Reduce to Eq. 26 in 2019_GuptaRallabandiStone_PRFluids.pdf inside the ‘relevant publications’ folder. Note that Eq. 26 in that paper is for diffusioosmosis and is thus going to have a negative sign and should be consistent with the result at the thin double layer limit only.”

BPM“Check for task-3: Ensure that the scaling analysis can reproduce the trends seen from the numerical results.”

A Finder window showing the folder for the diffusiophoresis problem: checks.md, code, corrections.md, figures, goals and tasks.txt, latex, relevant publications holding three PDFs, sessions, summary.md and tasks.md.
The folder for one of the two problems. The four markdown files are the project’s memory; relevant publications holds the three papers the model was allowed to read, and nothing else. Click to enlarge.

5. Keep a running log of progress, and ask a new session to only read summaries to further reduce error propagation. In this project, each problem folder carried four markdown files: the task list, the checks, the running summary, and a log of corrections. A session was explicitly told not to read other sessions’ transcripts to avoid inheriting mistakes. The summaries and the running logs are how the pieces are made to work together. I had the AI draft them, and gave permission only after reading them; where I needed clarification, I asked, and revised them if needed. The next step then reads only these summaries and the running logs of the tasks and the checks, which is what keeps errors from propagating.

6. Make sure that you are able to parse the AI’s progress periodically. This keeps you in the loop and up to date with what the tool is doing, and it avoids drifting. I did not proceed until things made sense to me. I got frustrated a few times. I have left the prompts as they were:

DP“This is too technical. Explain to me in 500-700 words on the overall potential of solving the problem using this approach”

BPM“Okay - I like this but walk me through in a detailed step by step manner. Some of the equations aren’t clarified fully. I want to understand all the different limits. Imagine no prior knowledge so explain scaling analysis clearly step by step so that I can fully understand the different results that you are providing”

DP“The write up is quite confusing and dense. Before you do anything else, can you write the expression of the final velocity in terms $D_i$, $z_i$, $c_{i\infty}$ and their summations, and a function of $\kappa$? I am just thinking to understand the structure”

BPM“You write very long responses that end up confusing more than helping. Physically, help me understand why I should assume $\Delta\mu_{\rm Na^+}$ to be zero”

BPM“Okay you are confusing me more”

DP“I also don’t understand your variable naming as it will confuse a reader”

7. Retain decision-making to yourself. This helps you avoid the tool wandering off in directions you do not anticipate being useful.

Existential thoughts and graduate training

Claude was able to solve both problems relatively easily via this framework. I did not spot any errors, unlike the first project. However, its responses were virtually unreadable. I had to spend a lot of time having it explain what exactly happened. In both problems, I had to give clear signals that it was not making sense, and I had to ask it to simplify the reasoning. The symbols it chose for the diffusiophoresis result were a good example, and so was my decision to leave a whole piece of algebra out of the paper because nobody would ever read it:

DP“I also don’t understand your variable naming as it will confuse a reader”

DP“maybe we separate with $\tilde\zeta$, $\tilde\zeta^2$, $\tilde\zeta^3$ terms, and then name them with supercript related to the $\tilde\zeta$ order, and the subscript w.r.t. the gradient term multiplying it …”

DP“Instead of doing task 16, let us table it as it will be hard to read, so record that I do not want to to do this now”

As my postdoc advisor told me a couple of times, bad notation can spoil a good result.

In another instance, I suggested the form of the final result that went into the pre-print. I did not know this result going in; I did not understand the trends reported in the literature. I first asked for plots of the numerical solution, and only after looking at them did I suggest splitting the problem into two limits, solved separately, rather than asking the model to find an answer:

BPM“create two models, one H+ free for under and limiting, and one Cl− free for overlimiting, and then I will just want to overlay them on top of the numerical result”

The tool probably knew that this simplification would work but did not simply think like a human. Therefore, that intuition and taste are key to using these tools well.

I was quite unsettled when I saw the problems I had been thinking about solved over a matter of days. In my estimate, a 2nd- to 3rd-year graduate student would need a year or so each to solve these problems. It is hard to come to terms with a timeline compressed by more than an order of magnitude. I texted many of my friends and colleagues that I was having an existential crisis and definitely had very bad sleep over these 15 days. While all of this is true, the fact that the output was not human-readable speaks to the fact that rigor in training is only more important.

For graduate training in the area of theoretical research, I would certainly suggest that some projects be pursued without AI, just to get used to the mental training of checking the work and being aware of most of the techniques. It is crucial to repeat that a few times before using these tools. While AI can likely give you a result autonomously, learning to interpret it and present it to humans is a skill that is not going to be acquired by prompting.

As a chess enthusiast, though a below-average player, I anticipate that the future of research might resemble the modern chess landscape. The chess engines do not teach you chess; practice does. Engines only become truly useful after a certain chess strength. Modern chess players use them to come up with clever ideas and interesting variations that were not accessible before. Furthermore, not all players become the same: they use the engines differently and preserve their style. Research may look similar. You get to a particular strength through mostly traditional routes, though AI might help. But once you have reached a particular strength, use it to advance science, while also preserving your own style and taste.

New results

So, what did we find? Two results, briefly shared.

Diffusiophoresis

Diffusiophoresis refers to the movement of charged particles, about a few micrometres in size, placed in a solution where there is a concentration difference of a dissolved solute. So, imagine small particles placed between less salty and more salty water. This phenomenon has been well studied for decades. It has been used to measure the surface charge of particles, to filter water without a membrane using nothing but dissolved carbon dioxide, to drive colloids into and out of dead-end pores, to get particles out of porous materials during rinsing, and to organise colloids into two-dimensional bands. In biology, it has been proposed as a mechanism for ATP-driven transport that needs no motor proteins, and as a way of sharpening the patterns that living systems form.

a negatively charged colloid in a gradient of NaCl; the lopsidedness of the ion cloud is drawn about three times larger than it is
In diffusiophoresis, particles can go towards higher salt concentration or lower salt concentration. It is made up of two mechanisms: electrophoresis and chemiphoresis. We sought to answer what the speed of particles will be when there is a mixture of salt. This answer was absent from the literature for arbitrary particle sizes. Prior work only focused on the so-called thin double layer limit, or large particle sizes.

The speed of the particle is naturally an important question. It has been worked out for all particle sizes, but only in a binary salt, that is, NaCl in water or KCl in water. Our question was: what happens to the velocity when there is a mixture of salts? Even in this mixture, I previously worked on finding the velocity for large particles, that is, when they are much larger than the Debye length. However, no relationship existed for all particle sizes. This was the key question.

I fed it some of my own papers and another known paper in the field, and specifically asked it to follow a direction I expected to work. This is quite a technical calculation, but AI was able to do it pretty fast. In fact, it found a typo in one of my prior papers too. The final result is a long expression that may not make a lot of sense on its own, but the key takeaway is that it self-consistently reduces to the known limits.

Figure 4 of the pre-print. A grey box at the top holds the general velocity formula for N ionic species at any double-layer thickness. Three coloured boxes below it are its restrictions: one binary z:z salt at any kappa; a mixture with a thin double layer, which returns eqn 26 of Gupta, Rallabandi and Stone (2019); and both restrictions together, which is the classical result of Prieve and co-workers (1984).
Fig. 4 of the pre-print: the general result, in the grey box, and the three known results it collapses to. Click to enlarge.

Full details, and the definition of every symbol, are in the pre-print. While this result is highly technical, Claude was able to navigate the calculations fairly well. I see many variations that might broaden the result in the future, such as investigating shape effects beyond spherical particles and relaxing the small Peclet number assumption.

Bipolar membranes

Bipolar membranes are a powerful technology in which positively charged and negatively charged layers are sandwiched together. Under “reverse” bias, you drive the counter-ions away from the junction. At large potentials, there is overlimiting current. The origin of the overlimiting current has various explanations, but the most common is that at large potentials the kinetics of water dissociation becomes important.

A bipolar membrane in reverse bias
Drag the voltage and watch the junction run out of salt, and the water ions take over. One state throughout: $c = 0.5$ M, $\chi = 2$ M.
regime
ohmic
−−− −−− +++ +++
junction salt $c_{\rm j}$
—
carried by water ions
—
current $I/I_{\rm lim}$
—

We were inspired by Pärnamäe and co-workers (R. Pärnamäe et al., “Origin of limiting and overlimiting currents in bipolar membranes”, Environ. Sci. Technol. 57, 9664–9674, 2023). They found that they are able to obtain overlimiting current even without any dissociation kinetics. They say so explicitly:

“our model that we used to obtain Figure 2 panels b and d does not include any description of the kinetic rate of water dissociation. Instead, we assume that the kinetics of the water dissociation reaction are infinitely fast. Our results indicate that we do not need to include a possible role of the electric field on the rate of water dissociation to simulate current–voltage curves that exhibit a clear overlimiting region with a current ‘takeoff’.”

They had analytical results for the limiting current, but not for the overlimiting current, and they are candid that their own analytical model “predicts well all the I–V curve regions where salt ions carry majority of the current … but not the overlimiting region.” Our question was whether it is possible to obtain one fully.

It is, and the whole current–voltage curve turns out to be a plain sum of two pieces:

$$I \simeq \underbrace{\frac{2FDc^2}{\chi\ell}\left(1-e^{-V_{\rm bpm}/V_{\rm T}}\right)}_{\text{salt, the plateau}} \;+\; \underbrace{\frac{FD_{\rm H}\chi}{\ell}\ln\!\left[\frac{c+c_we^{V_{\rm bpm}/2V_{\rm T}}}{c+c_w}\right]}_{\text{protons, the take-off}}$$
$c$ is the salt concentration in the reservoir, $c_w=10^{-7}$ M the water-ion concentration at pH 7, $\chi$ the fixed charge density of one layer, $\ell$ its thickness, $D$ the salt diffusivity and $V_{\rm bpm}$ the voltage across the membrane.

Below, the grey circles are the full three-ion problem solved numerically, with no approximations. The red line is the formula above, and the two dashed lines are its two halves.

One formula against the full numerical solution
Every grey circle is a converged solve of the three-ion problem. Nothing below is fitted.
limiting current $I_{\rm lim}$
—
take-off voltage $V_0$
—
charge ratio $\chi/c$
—
worst mismatch
—
Fixed throughout: layer thickness $\ell = 100~\mu$m, $c_w = 10^{-7}$ M, salt diffusivity $D = 4\times10^{-11}$ m$^2$ s$^{-1}$, $D_{\rm H}/D = 5$, $T = 298.15$ K. The numerical points come from the same shooting solver that produced the figure in the paper.

While this result might sound “simple”, I was quite amazed that I was able to arrive at it so fast. Of course, we borrowed heavily from a recently published paper, but being able to break down the problem and show that an analytical expression of overlimiting current can be achieved without water dissociation kinetics is quite exciting. There are many extensions possible in the future, such as inclusion of asymmetry in membranes and including non-idealities in the transport equations.

So, what is next?

This project was a surreal experience. I felt elated and scared at the same time. The fact that I was able to solve two PhD-level problems in 15 days from start to finish is incredible — with the caveat that I had thought about both before, and that my experience is well beyond a graduate student’s.

I should note that some of these conclusions are likely specific to theoretical research, and it would be useful to see how the method should be adjusted for other types of research, such as experimental analysis of large data sets and software development. Even in those cases, I’d argue that the focus should be to retain decision-making with humans and to emphasise reducing error propagation, instead of mainly optimising for speed.

I say this because these tools already automate a great deal of research, and they are still moving fast. It may well be that these two weeks become a day. But speed runs into diminishing returns, because having more results is not the same as understanding them. If we have a question, getting to an answer fast is not always the point; the solution process is just as important, if not more. What I would rather see us optimise for is the quality of the questions and the insight we get at the end of them. I hope we can preserve this spirit as these tools get more widely adopted.

If you enjoyed reading this post, please feel free to contact me via email or connect on LinkedIn. If you have thoughts about how to use these tools in your own research, or if you would like me to give a presentation on this, I would love to hear from you. I also hope the theoretical fluids, soft matter, electrokinetics and multiphysics community sees this as a way to go after bigger and harder problems.

Acknowledgements. I thank the NSF CAREER program (CBET-2238412) and the Air Force Office of Scientific Research (FA9550-25-1-0176, Young Investigator Program award) for financial support.

A note on AI use. The narrative on this page is human-written; AI was used only to spell-check, grammar-check and fact-check it. The plots, the interactive widgets and the page organisation were AI-assisted. The same split applies to the pre-print: the text is mine, and AI organised references, drew figures and typeset equations.