you are viewing a single comment's thread
view the rest of the comments
[–] 2 points 4 days ago (15 children)

If I ask "why did the LLM output "for" as the XXXXth word of its utterance, can Linus say why?

If you have the model that was used, and the seed used for the generation, then yes you can trace the weights and figure out how everything was generated.

AI is deterministic. And compilers can be just as "nondeterministic" if you don't know what compiler was used and what flags were enabled.

  • source
  • parent
  • hideshow 15 child comments
  • [–] 12 points 4 days ago

    Because weight x = y isn't really a satisfactory answer to the "why" in question though. To really answer that you need to refer to the pretraining and context, which in a lot of cases today, and likely forever, since there's no reason for anyone to cold start model training ever again, is necessarily opaque. A lot of the best why answers are going to be given by the model itself (which... obviously circular). Trust and attribution are just really hard in this paradigm. Not necessarily so different from the challenge of trusting/attributing human output, except that humans are more diverse and in general difficult to manipulate.

  • source
  • parent
  • [–] 8 points 4 days ago (2 children)

    AI is not deterministic at all, only if you keep the seed values for generating random numbers the same all over the pipeline.

    It's literally a huge stochastic model.

  • source
  • parent
  • hideshow 2 child comments
  • [–] 4 points 3 days ago* (1 child)

    All I'm saying is that determinism has a specific meaning in computer science. In an LLM, the rng value is determined by the seed. Given the same inputs, an LLM always produces the same output. It does not matter whether the user understands the code or operation at all. It is purely dependent on the program itself.

    A non-deterministic program, is one where the output is determined by factors outside the code itself. This usually requires non-deterministic programming language constructs. For example, if you convert a set to a list in python, the order of the elements is non-deterministic. Out of the control of the program. Same inputs, different output.

  • source
  • parent
  • hideshow 1 child comment
  • [–] 4 points 4 days ago

    I had the misfortune of working a lot with claude skills for the past few months. I run the exact same skill, on the exact same codebase and it doesn't yield the same results. Sometimes it straight up ignores parts my prompt. Other times it ignores the skill file entirely. And then I ask Claude, why did it do X thing that it wasn't supposed to do? The answer is "I apologize, I should have blabla". It is extremely unreliable and unpredictable. Now I'm stuck with a feature that I'm responsible for that occasionally goes rogue. Fun times.

  • source
  • parent
  • [–] 3 points 4 days ago* (4 children)

    Nearly all evaluation steps for an LLM I produce some level of entropy. Yes you can evaluate an LLM model deterministically, but we don't. We even tune the levels to get good results. Model cards have sampling parameters supplied to give "the best" results. For example, Qwen 3.8 flash next gives

    We recommend using the following sets of sampling parameters for generation:

    Thinking Mode: temperature=1.0, top_p=0.95, top_k=20, min_p=0.0, presence_penalty=0.0, repetition_penalty=1.0

    Instruct (or non-thinking) mode: temperature=0.7, top_p=0.80, top_k=20, min_p=0.0, presence_penalty=1.5, repetition_penalty=1.0

    Replaying the seed will only get you the same result using a particular engine and a particular random number generator. Run it on llama.cpp Vs Strata and you can get different results. Different libc, different results.

    A compiler is systematically deterministic. No calls to rand()

  • source
  • parent
  • hideshow 4 child comments
  • [–] 2 points 3 days ago (3 children)

    Replaying the seed will only get you the same result using a particular engine and a particular random number generator

    And the seed and rng are all part of the LLM. If you use the same inputs you get the same output. That's the definition of determinism.

    Determinism does not care whether or not the user/programmer understands the program or not. The word you're probably looking for is "unpredictable" or "less predictable".

  • source
  • parent
  • hideshow 3 child comments
  • [–] 2 points 3 days ago (2 children)

    Everybody understands what you're saying. Yes, the source of randomness in a computer is deterministic (unless you have a physical source of entropy). Every computer program is deterministic.

    Nothing about the operation of LLMs relys on that determinism or views it as useful. LLMs are probabilistic in nature and require randomness (emulated or real). When people are saying it's not deterministic they are stating that there are multiple outputs possible for a single input (excluding the seed to the RNG because it's not necessary to use a deterministic source of randomness).

    That is fundamentally different to a compiler, which is the overall point being made.

  • source
  • parent
  • hideshow 2 child comments
  • [–] 1 point 3 days ago* (1 child)

    The compiler can use rng too. From the gcc docs:

    Sometimes gcc will opt to use a randomized model to guess branch probabilities, when none are available from either profiling feedback (-fprofile-arcs) or __builtin_expect.

    More info here: https://stackoverflow.com/questions/52974259/what-are-some-examples-of-non-determinism-in-the-c-compiler

    I'm willing to bet many people are not even aware that modern compiler optimizations use prng. Not to mention incorrect usage of the term "determinism" when referring to CS concepts. This is exactly what Linus is talking about when he cited lack of understanding of compiler behavior. I do believe there are notable differences between AI and compiler, but a lot of the reasons people give against AI are reactionary and not well thought out.

  • source
  • parent
  • hideshow 1 child comment
  • [–] 3 points 4 days ago (4 children)

    You make a good point about capability. However, I'm trying to say that in practical capability, I do know exactly what compiler flags were enabled (it's whatever the Makefile passed, which is whatever configure determined, the whole thing is checked in as source code), but the exact model+seed isn't being recorded for this Linux changes.

    To make the compiler analogy, we should be saving model, seed, prompt, etc and then the LLM output becomes the equivalent of the compiled code. I think that's an extremely defensible argument, while "bet you can't write assembly!" is not.

  • source
  • parent
  • hideshow 4 child comments
  • [–] 1 point 3 days ago (3 children)

    For local AI image generation, often the input parameters are indeed recorded into the output image. You can then use the metadata of the image to get the parameters and re-generate the exact same image. This is the definition of determinism in computer science.

  • source
  • parent
  • hideshow 3 child comments
  • [–] 1 point 3 days ago (2 children)

    Is that what Linus is talking about in the OP? I was sure this was about code-generation. If he's talking about images and recording the metadata then I agree with you.

  • source
  • parent
  • hideshow 2 child comments