LLMs predict my coffee

(dynomight.net)

69 points | by surprisetalk 4 days ago

10 comments

  • persedes 18 minutes ago
    That initial drop reminds me of one of the things that stuck to me from my thermodynamic lectures / tests: If you want to drink coffee at a drinkable temperature in t=15min, will it be colder if you add the milk first or wait 15min and then add milk? (=waiting 15 min because the temperature differential is greater and causes a larger drop). Almost useless fact, but it always comes up when making coffee.
    • unholiness 10 minutes ago
      This is true if the milk is in the fridge the whole time. With the milk out the whole time, it's nearly the same, exact answer depends on the geometry of both containers.
  • AuthAuth 4 minutes ago
    Irrelevant to your specific cup of coffee its giving you a generic answer.
  • detectivestory 2 hours ago
    On a related note, I have been working on an app that helps determine the correct grinder setting when dialing in espresso. After logging two shots with the same setup (grinder, coffeee machine, basket etc), it then uses machine learning (and some other stuff that I am still improving) to predict the correct setting for your grinder based on the machine temperature, the weight of the shot etc.

    https://apps.apple.com/ph/app/grind-finer-app/id6760079211

    Its far from perfect when it comes to predictions right now but I expect to have massive improvements over the coming weeks. For now it works ok as an espresso log at least.

    I'm hoping after a few tweaks I can save people a lot of wasted coffee!

    • gerdesj 29 minutes ago
      Me and the wife (en_GB - draw your own conclusions!) love a decent coffee but can't be arsed with too much wankery over it. We have owned a few kitchen built in units and I've messed with a couple of grinders and espresso pots in the past.

      Wifey found a kitchen built in unit a few years ago and it is still doing the job, very nicely.

      Let's face it, what you want is a decent coffee and you have to start from that point, not what sort of bump or grind (that's grindr).

      I want a cup of coffee with: - Correct volume - sometimes a shot, mostly an "Americano" - I'm British don't you know - Correct temperature - it'll go really bitter if too hot. Too cold - ... it'll be cold. - Crema - A soft top is non negotiable - Flavour - Ingredients and temperature (mostly)

      The unit we have now manages bean to cup quite reasonably, without any mensuration facilities. I have made coffee for several Italians and they were quite happy with the results.

    • a10c 1 hour ago
      Funnily enough I have built essentially the exact same thing in HomeAssistant. Shot collection is completely automated as I have a LM Linea Micra and Acaia Lunar scales (Both have integrations that use Bluetooth). You should consider support for bluetooth scales etc!

      https://i.imgur.com/a5ztsco.jpeg

    • rrr_oh_man 1 hour ago
      Missed chance to call it Grind Finr
  • amha 3 hours ago
    There's a simple differential equation often taught in intro calc courses, "Newton's Law of Cooling/Heating," which basically says that the rate of heat loss is proportional to the difference in temperature between a substance and its environment. I'm curious what that'd look like here. It's a very simple model, of course, not taking into account all the variables that Dynomight points out, but if a simple model can be nearly as predictive as more complex models...

    I'm also curious to see the details of the models that Dynomight's LLMs produced!

    • 3eb7988a1663 3 hours ago
      The appendix lists the equations transcribed from the raw answers.

        LLM  T(t)  Cost
        Kimi K2.5 (reasoning)  20 + 52.9 exp(-t/3600)+ 27.1 exp(-t/80)  $0.01
        Gemini 3.1 Pro  20 + 53 exp(-t/2500) + 27 exp(-t/149.25)  $0.09
        GPT 5.4  20 + 54.6 exp(-t/2920) + 25.4 exp(-t/68.1)  $0.11
        Claude 4.6 Opus (reasoning)  20 + 55 exp(-t/1700) + 25 exp(-t/43)  $0.61 (eeek)
        Qwen3-235B  20 + 53.17 exp(-t/1414.43)  $0.009
        GLM-4.7 (reasoning)  20 + 53.2 exp(-t/2500)  $0.03
      • kurthr 3 hours ago
        It looks like a lot of them are missing something big. I'd think the two big ones are the evaporative cooling as you pour into the cup, and heating up the cup (by convection) itself. The convective cooling to the air is tertiary, but important (and conduction of the mug to the table probably isn't completely negligible). If there's only one exponential, they're definitely doing something wrong.

        I'd like to see a sensitivity study to see how much those terms would need to be changed to match within a few %. Exponentials are really tweaky!

        • andai 2 hours ago
          Is that what that first drop is? The cold cup stealing heat from the coffee?
          • kadoban 2 hours ago
            It's a mix of course, but I think it should be mainly that and evaporative cooling. Evap is _very_ effective but will fall off rapidly as you get away from boiling. The conduction into the mug will depend a lot on the mug material but will slow down a lot as the mug approaches the water temperature.

            I'd be very interested in seeing separate graphs for each major component and how they add up to the total. Even asking the LLMs to separate it out might improve some of their results, would be interesting to try that too.

    • amelius 3 hours ago
      That model doesn't explain the relatively sharp drop in the beginning.
      • bryan0 3 hours ago
        Are you sure? I believe Newtown's law of cooling says the temperature will drop sharply at the beginning:

        dT/dt = -k(T_0 - T_room)

        so T(t) = T_room + (T_0 - T_room) exp(-kt)

        exp(-x) has a fast drop off then levels off.

        • amelius 2 hours ago
          https://www.electronics-tutorials.ws/rc/time-constant.html

          scroll down, these graphs just don't look similar.

        • cyberax 1 hour ago
          Ha. My university professor used this in a lab to catch people who slack off.

          There is another factor here: convection. Its speed depends on the viscosity of the fluid and the temperature difference both. And viscosity itself depends on the temperature, so you get this very sharp dropoff.

      • coder68 3 hours ago
        It does? There is a fast drop followed by a long decay, exponential in fact. The cooling rate is proportional to the temperature difference, so the drop is sharpest at the very beginning when the object is hottest.
        • amelius 3 hours ago
          I mean that initial drop doesn't look like it is part of the same exponential decay.
      • lacunary 2 hours ago
        probably dominated by the cup as the ambient temperature initially and then as air/the counter top as the ambient temperature on the longer time scale, once the cup and the liquid near equilibrium
  • andy99 3 hours ago

      Does that seem hard? I think it’s hard. The relevant physical phenomena include at least..,
    
    In most engineering problems, the starting point is recognizing that usually one or two key things will dominate and the rest won’t matter.
  • shdudns 2 hours ago
    The problem is both highly complex, but fairly easy to model. Engineers have been doing this for over a century.

    Of all the cooling modes identified by the author, one will dominate. And it is almost certainly going to have an exponential relationship with time.

    Once this mode decays below the next fastest will this new fastest mode will dominate.

    All the LLM has to do, then, is give a reasonable estimate for the Q for:

    $T = To exp(-Qt)$

    This is not too hard to fit if your training set has the internet within itself.

    I would have been more interested to see the equations than the plots, but I would have been most interested to see the plots in log space. There, each cooling mode is a straight line.

    The data collected, btw, appears to have at least two exponential modes within it.

    [The author did not list the temperature dependance of heat capacity, which for pure water is fairly constant]

  • jofzar 2 hours ago
    " Does that seem hard? I think it’s hard. The relevant physical phenomena include at least"

    Imo no, this seems like something that would be in multiple scientific papers so a LLM would be able to generate the answer based on predictive text.

    • shdudns 2 hours ago
      A full model of a cup of water cooling is, in fact, incredibly difficult.

      Impossible, since it is chaotic.

      But a T(t) model should not be too hard for an LLM with a basic heat transfer book in its training set.

      • SchemaLoad 1 hour ago
        You don't need a full model of every atomic interaction because all of those chaotic interactions end up averaging out. Given enough coin flips you will end up on a 50/50 split even if the individual flips are unpredictable. Given enough atomic interactions the heat will transfer in the same way every time.
  • kaelandt 3 hours ago
    It isn't that surprising that it works well, this problem is fairly well known and some simple heat equations would lead to the result, about which there is a lot of training data online.
  • IncreasePosts 2 hours ago
    The water temperature drops quickly because the room temperature ceramic mug is getting heated to near equilibrium with the water. If you used a vacuum sealed mug(thermos) then the water temp would drop a bit but not much at all initially.
  • leecommamichael 3 hours ago
    ... and so another benchmark is born.