Coding agents think ahead of time

(arxiv.org)

30 points | by andre15silva 1 hour ago

10 comments

  • HarHarVeryFunny 7 minutes ago
    This feels to me more like incremental belief building than "thinking ahead of time" (which is not what the paper is claiming).

    The model only has partial observability of the program it is working on (whatever tool call outputs are present in the context), as well as the trajectory of actions it has taken, and from this is building up some internal beliefs about the program - the probes used were looking for pretty crude things like "is this program well-formed" and "is this program correct (will it pass tests)".

    The paper says that these program "properties" (beliefs) predict future state of the program up to 25 "steps" ahead, but given the setup this seems to be expected. An agent is trying to fix a program and/or maintain it in a working state, so it doesn't seem surprising that current well-formedness and correctness persist into the future, or that the model is "optimistic" about the outcome of the next action it is planning/predicting.

    This incremental belief building from partial observability reminds me of the ability of LLMs to predict valid chess moves when only given a truncated history of the games moves so far (e.g. last 20 moves, not all moves back to start of the game).

  • subygan 8 minutes ago
    This is true of truly skillful people in their craft as well.

    I know people, who initialize all required variables and write the logic after. which used to feel bonkers to me until I realized, they've done enough practice and memorization to be able to figure what they would need 10 steps down the line.

    this does show that, models have a better model of the task and the expected end state.

  • energy123 1 hour ago
    Confirmatory of Sutskever's view that predicting the next token forces a deep understanding. To effectively predict the next token it needs a good idea of what comes after the next token.
    • guhcampos 50 minutes ago
      Isn't that what "Attention is all you need" was about anyway? Does not sound like news to me.
    • chrisjj 44 minutes ago
      > To effectively predict the next token it needs a good idea of what comes after the next token.

      And that's all it needs. Not reasoning.

      • wongarsu 11 minutes ago
        At some level of performance, reasoning becomes the most effective method to predict the next token
      • brookst 28 minutes ago
        Save us from the reasoning / sentience / consciousness / thinking semantic quicksand.

        Babbage’s Analytical Engine didn’t actually analyze anything, and terminology hadn’t gotten any more clear-cut since.

      • vidarh 25 minutes ago
        How do you define reasoning in a measurable way?
    • IAmGraydon 37 minutes ago
      [flagged]
  • x312 33 minutes ago
    It's been known for several years that LLM activations encode future tokens ahead of time (e.g. https://arxiv.org/abs/2404.00859).

    But this has only been shown on simple tasks, so I think this paper is still quite neat. The interesting thing is that they show "future horizon length" varies across models.

  • mkagenius 23 minutes ago
    I used to ask my coding agent to present two alternatives to choose from while implementing a task, and include a tokens required for each alternative to implement. (So that I can choose one which needs less token vs one which needs more rigour depending on task)

    Finally there is evidence that the model kinda actually knows the correct token spend on each method.

  • jstanley 23 minutes ago
    It makes intuitive sense. How else could you write a 500-line script top-to-bottom with no backspace key and no arrow keys and get all the imports etc. right upfront?
    • wren6991 8 minutes ago
      ...by inferring both the imports and the script body from the same context? I think you're suggesting there's some kind of information flow from the anticipated body of the script back up to the imports, but I don't see why that would be necessary. Infer imports from context, infer body from context + imports. All strictly causal.
      • jstanley 5 minutes ago
        Sure, try it. It's harder than you think. It's not just imports, it's the entire program.

        > you're suggesting there's some kind of information flow from the anticipated body of the script back up to the imports

        Yes, I am suggesting this. I don't think it is possible to write programs without either anticipating what you're going to write down below before you get there, or else being able to go back and edit what you already wrote.

        Of course agent harnesses allow the latter, but raw models without a harness can still do an exceptionally, superhumanly, good job of straight-line programming with no editing.

        > Infer imports from context, infer body from context + imports. All strictly causal.

        Of course it's causal, that's kind of a reductive way to look at it.

        Just infer the entire program from context and then type what you inferred.

  • phkahler 38 minutes ago
    >> Probes trained to predict the outcome of future edits (before they are materialized and written on disk) achieve performance above chance up to roughly 25 steps in advance.

    Are these probes effectively run in parallel? The way this reads is more about predicting a future outcome than keeping the current token relevant based on past tokens.

  • pal9000i 46 minutes ago
    How is this news? isn't it an obvious fact from the Transformer architecture?
    • NitpickLawyer 28 minutes ago
      > isn't it an obvious fact

      Just below your question is a very confidently incorrect take about "parroting"... So, not obvious at all, at least for some people :)

    • energy123 42 minutes ago
      It's a mechanistic interpretability tool. Useful even if it is not surprising.
  • jdw64 23 minutes ago
    In other words, since the next semantic prediction for forecasting the future is built on the training dataset, it's hard for anything truly new to emerge.

    Then how do humans create something 'creative'—something that didn't exist before? I think it might be because the process of simplifying the complex system of nature differs between individuals. The data being learned now is all labeled by humans and simplified through human cognition. Within that kind of information, creativity seems hard to emerge.

    Ultimately, with data that already contains interpretation, no matter how much you repeat the learning, it just becomes an encyclopedia that only explores within human knowledge, repeating predictions within human interpretation. So I wonder if we actually need a different encoder that interprets raw data—not based on human interpretation.

    In reality, what changed Newton's absolute time to Einstein's relativity was a conclusion derived simply from observing the world. Newton's interpretation was supported by a lot of evidence in its time. If an AI studied all the medieval data from Newton's era, could it actually come up with the theory of relativity?

    I'm always curious about this. I think AI is already very good at coding and will soon become better than humans. Logical structures are ultimately human interpretations, and reasoning within that framework is something AI can probably do more logically than humans. In other words, once humans create the framework, stacking the logical Jenga blocks within it—AI will be better at that.

    But true creativity lies in breaking the framework itself, and I'm skeptical about whether AI can do that. The encoder also seems insufficient. There will likely be limits. I might be trapped in my own biases.

    But the limitations of the current approach seem too clear to ignore.

    When I look at the approach of these papers, it feels like an argument that adding shadows that imitate the world will eventually make them become the objects themselves.

    I think the text, code, images, papers, and conversations that humans leave behind are not the world itself, but rather shadows of the world that have passed through human cognition and language. No matter how much you learn from those shadows, whether that leads to the ability to actually engage with the objects themselves seems like a separate issue.

    I feel like something different is needed. But I'm not intellectually sharp enough to reason this through logically.this is just my intuition

  • chrisjj 45 minutes ago
    > A coding agent solving a software-engineering task spends dozens of steps reasoning

    No. That's simple PR hype. Parrotry is not reasoning.

    • astro1234 26 minutes ago
      Why not? I think there’s fairly strong evidence that there is something that convincingly looks like reasoning. I think anthropic has done some nice circuit tracing and mechanistic interpretability work on this for instance.
    • brookst 27 minutes ago
      There is a certain amount of irony in your comment that I hope you appreciate.
    • vidarh 24 minutes ago
      What exactly do you consider reasoning?