Posts

Showing posts from April, 2025

The importance of choosing the right first queries to your LLM (2025-03)

Failure and then success in querying an LLM I enjoy accelerating my software development with the help of LLMs. However, this extra LLM based support does not always work. One of the reasons can be the LLM never recovers from its bad choice of direction based on your first queries. Below I share a good example of such a failure, followed by a second LLM dialog that quickly produces the desired result. Then I explain what is happening. Here is the dialog that fails, I am trying to get the LLM to produce a draft differentiation approximation based on wavelets, and coded in JAX: Me: Do some wavelets have special properties with regards to derivatives? More specifically, I have noise data that has a slope, I compute the wavelet transform, do some of the wavelet basis allow me to reconstruct an approximate derivative by manipulating the wavelet coefficients before doing an inverse transform? (To note that I naturally try not to impose my knowledge, and therefore why I tend to caref...

Playing with LLMs to code some math (2025-03)

  LLM assisted coded help dialog Just before lunch today, I left a message for my son, asking for help with sklearn. Then I thought: Gemini should be able to help me.This is the resulting dialog (summarized): Me: I have some x y data points that tend to follow a linear trend but with this trend abruptly changing from time to time. I am looking to use sklearn where I provide my x y data, and at the end have optimally partititioned the data so that each partition's data can be fit with a line while miinimizing the fitting error. Can you help me? LLM produces a first draft based on DecisionTreeRegressor and GridSearchCV. I run it on a small dataset. Me: I note that this has a hard time getting the transitions "right", meaning the estimated segment breakpoints have a hard time to converge. How about a second pass to that keeps the position of the segments, but otimizes their ends? LLM proposes code, but forgets that it should be a second pass. Me: Hmm, I think you would want...