frontpage.
newsnewestaskshowjobs

Made with ♥ by @iamnishanth

Open Source @Github

fp.

Windows 3.1 tiled background .bmp archive

https://github.com/andreasjansson/win-3.1-backgrounds
122•justsomehnguy•2h ago•33 comments

FCC Updates Covered List to Include Foreign-Made Consumer Routers

https://www.fcc.gov/document/fcc-updates-covered-list-include-foreign-made-consumer-routers
157•moonka•4h ago•97 comments

Autoresearch on an old research idea

https://ykumar.me/blog/eclip-autoresearch/
263•ykumards•6h ago•66 comments

iPhone 17 Pro Demonstrated Running a 400B LLM

https://twitter.com/anemll/status/2035901335984611412
476•anemll•11h ago•238 comments

Ju Ci: The Art of Repairing Porcelain

https://thesublimeblog.org/2025/03/13/ju-ci-the-ancient-art-of-repairing-porcelain/
48•lawrenceyan•2d ago•6 comments

Show HN: Cq – Stack Overflow for AI coding agents

https://blog.mozilla.ai/cq-stack-overflow-for-agents/
57•peteski22•9h ago•19 comments

IRIX 3dfx Voodoo driver and glide2x IRIX port

https://sdz-mods.com/index.php/2026/03/23/irix-3dfx-voodoo-driver-glide2x-irix-port/
30•zdw•2h ago•0 comments

Local Stack Archived their GitHub repo and requires an account to run

https://github.com/localstack/localstack
153•ecshafer•6h ago•80 comments

Claude Code Cheat Sheet

https://cc.storyfox.cz
137•phasE89•3h ago•43 comments

Dune3d: A parametric 3D CAD application

https://github.com/dune3d/dune3d
101•luu•1d ago•30 comments

Finding all regex matches has always been O(n²)

https://iev.ee/blog/the-quadratic-problem-nobody-fixed/
153•lalitmaganti•4d ago•40 comments

Abusing Customizable Selects

https://css-tricks.com/abusing-customizable-selects/
11•speckx•5d ago•1 comments

Trivy under attack again: Widespread GitHub Actions tag compromise secrets

https://socket.dev/blog/trivy-under-attack-again-github-actions-compromise
155•jicea•1d ago•57 comments

A retro terminal music player inspired by Winamp

https://github.com/bjarneo/cliamp
44•mkagenius•4h ago•4 comments

An incoherent Rust

https://www.boxyuwu.blog/posts/an-incoherent-rust/
119•emschwartz•10h ago•49 comments

Two pilots dead after plane and ground vehicle collide at LaGuardia

https://www.bbc.com/news/articles/cy01g522ww4o
340•mememememememo•18h ago•529 comments

Study: Workers who fall for 'corporate bullshit' may be worse at their jobs

https://www.theguardian.com/business/2026/mar/23/corporate-speak-study
10•DamnInteresting•2h ago•1 comments

BIO: The Bao I/O Coprocessor

https://www.bunniestudios.com/blog/2026/bio-the-bao-i-o-coprocessor/
120•zdw•3d ago•26 comments

I built an AI receptionist for a mechanic shop

https://www.itsthatlady.dev/blog/building-an-ai-receptionist-for-my-brother/
210•mooreds•14h ago•233 comments

Designing AI for Disruptive Science

https://www.asimov.press/p/ai-science
62•mailyk•7h ago•37 comments

US and TotalEnergies reach 'nearly $1B' deal to end offshore wind projects

https://www.lemonde.fr/en/international/article/2026/03/23/us-and-totalenergies-reach-nearly-1-bi...
335•lode•7h ago•238 comments

How I'm Productive with Claude Code

https://neilkakkar.com/productive-with-claude-code.html
110•neilkakkar•4h ago•79 comments

An unsolicited guide to being a researcher [pdf]

https://emerge-lab.github.io/papers/an-unsolicited-guide-to-good-research.pdf
166•sebg•4d ago•21 comments

Bombadil: Property-based testing for web UIs

https://github.com/antithesishq/bombadil
221•Klaster_1•4d ago•88 comments

Pentagon Adopts New Limits for Journalists After Court Loss

https://www.nytimes.com/2026/03/23/business/media/pentagon-closes-journalists-work-area.html
42•doener•2h ago•10 comments

America tells private firms to “hack back”

https://www.economist.com/united-states/2026/03/22/america-tells-private-firms-to-hack-back
108•andsoitis•12h ago•119 comments

AI boom risks widening wealth divide, says BlackRock's Larry Fink

https://www.theguardian.com/technology/2026/mar/23/ai-boom-risks-widening-wealth-divide-blackrock...
27•devonnull•1h ago•7 comments

Digs: iOS app that syncs your Discogs collection and lets you browse it offline

https://lustin.fr/blog/building-digs/
48•rlustin•16h ago•19 comments

Migrating to the EU

https://rz01.org/eu-migration/
827•exitnode•15h ago•635 comments

“Collaboration” is bullshit

https://www.joanwestenberg.com/collaboration-is-bullshit/
303•mitchbob•23h ago•160 comments
Open in hackernews

Can LLMs do randomness?

https://rnikhil.com/2025/04/26/llm-coin-toss-odd-even
61•whoami_nr•10mo ago

Comments

dr_dshiv•10mo ago
Oh, surprising that Claude can do heads/tails.

In a project last year, I did a combination of LLMs plus a list of random numbers from a quantum computer. Random numbers are the only useful things quantum computers can produce—and that is one thing LLMs are terrible at

captn3m0•10mo ago
Wouldn’t any randomness (for a fixed combination of hardware and weights) be a result of the temperature and any randomness inserted at inference-time?

Otherwise, doing a H/T comparison is just a proxy to what the underlying token probabilities are and the temperature configuration (+hardware differences for a remote-hosted model).

delusional•10mo ago
Congratulations, this was all a test to see if there were anyone on HN with any knowledge of how LLMs work, and you gave the correct answer.
moffkalast•10mo ago
I was gonna say floating point errors might contribute especially at fp16 and fp8, but those are technically deterministic.
whoami_nr•10mo ago
Author here. Yeah totally agreed. The more rigorous way to do this would be to use a fixed seed and temp and in a local model setting and then sample the logprobs and then analyse that data.

I had an hour to kill and did this experiment.

DimitriBouriez•10mo ago
One thing to consider: we don’t know if these LLMs are wrapped with server-side logic that injects randomness (e.g. using actual code or external RNG). The outputs might not come purely from the model's token probabilities, but from some opaque post-processing layer. That’s a major blind spot in this kind of testing.
remoquete•10mo ago
Agreed. These tests should be performed on local models.
orbital-decay•10mo ago
You're right, although tests like this have been done many times locally as well. This issue comes from the fact that RL usually kills the token prediction variance, disproportionately narrowing it to 2-3 likely choices in the output distribution even in cases where uncertainty calls for hundreds. This is also a major factor behind fixed LLM stereotypes and -isms. Base models usually don't exhibit that behavior and have sufficient randomness.
avianlyric•10mo ago
The core of an LLM is completely deterministic. The randomness seen in LLM output is purely the result of post processing the output of the pure neural net part of the LLM, which exists explicitly to inject randomness into the generation process.

This what the “temperature” parameter of an LLM controls. Setting the temperature of an LLM to 0 effectively disables that randomness, but the result is a very boring output that’s likely to end up caught in a never ending loop of useless output.

sgk284•10mo ago
Fun post! Back during the holidays we wrote one where we abused temperature AND structured output to approximate a random selection: https://bits.logic.inc/p/all-i-want-for-christmas-is-a-rando...
onionisafruit•10mo ago
I enjoyed that.

When you asked it to choose by picking a random number between 1 and 4, it skewed the results heavily to 2 and 3. It could have interpreted your instructions to mean literally between 1 and 4 (not inclusive).

sgk284•10mo ago
Yea, absolutely. That's a good point. We could have phrased that more clearly.
LourensT•10mo ago
could you use structured output to make a more efficient estimator for the logits based?
sgk284•10mo ago
The two mechanisms are a bit disjoint, so I don't think it's the right tool to do so. Though it could have been an interesting experiment.
p1dda•10mo ago
LLMs doesn't even understand basic logic dude, or physics or gravity
bestest•10mo ago
I would suggest them to repeat the experiment while including sets from answers to "choose heads or tails" AND "choose tails or heads", ditto for numbers or rephrase the question to not include a "choice" (choose from 0 to 9 (btw, they're asking to choose from 0 to 10 inclusive, which is inherently wrong as the even subset is bigger in this case)), but rather "choose a random integer".
jansan•10mo ago
What I find more important is the ability to get reproducible results for testing.

I do not know about other LLMs, but Cohere allows setting a seed value. When setting the same seed value it will always give you the same result for a specific prompt (of course unless the LLM gets an update).

OTOH I would guess that they normally simply generate a random seed value on the server side when processing a prompt, and it depends on their random number generator how random that really is.

ekianjo•10mo ago
That's expected behavior when you run LLM locally with a fixed seed and temperature at zero
evertedsphere•10mo ago
0-10 inclusive is one extra even
whoami_nr•10mo ago
Author here. I know 0-10 is one extra even number. I also just did this for fun so don't take the statistical significance aspect of it very seriously. You also need to run this multiple times with multiple temperature and top_p values to do this more rigorously.
Mr_Modulo•10mo ago
In the summary at the top it says you used 0-10 but then for the prompt it says 1-10. I had assumed the summary was incorrect but I guess it's the prompt that's wrong?
segh•10mo ago
Cool experiment! My intuition suggests you would get a better result if you let the LLM generate tokens for a while before giving you an answer. Could be another experiment idea to see what kind of instructions lead to better randomness. (And to extend this, whether these instructions help humans better generate random numbers too.)
hleszek•10mo ago
Can humans do randomness? Obviously not and I expect if you ask people for a random number, then odd numbers will predominate.
whoami_nr•10mo ago
Veritasium did a video on this. Most people guess 37 when asked to pick between 1-100
hoseja•10mo ago
100/e rounded is 37

Pretty good.

Repose0941•10mo ago
Is randomness even possible? You can't technically prove it just see it, more likely to be close to that, in https://www.random.org/#learn they talk a little about this
sebstefan•10mo ago
That's an interrogation as old as time
baalimago•10mo ago
I'd be interested to see the bias in random character generation. It's something which would be closer to the domains of LLMs, seeing that they're 'next word generators' (based on probability).

How cryptographically secure would an LLM rng seed generator be?

GuB-42•10mo ago
Is the LLM reset between each event?

If LLMs are anything like people, I would expect a different result depending on that. The idea that random events are independent is very unintuitive to us, resulting in what we call the Gambler's Fallacy. LLMs attempts at randomness are very likely to be just as biased, if not more.

maaaaattttt•10mo ago
I think randomness needs to be better defined. In the article it seems to be that randomness should be an evenly distributed type of event occurences. I agree that it is very unintuitive for us as, I believe, we assume randomness to be any sequence of event that doesn't follow any known/recognizable pattern. Show a section of the Fibonacci to a 10 yo kid and they will most likely find the sequence of numbers to be random (maybe they will note that it is always increasing, but that's it). Even in this article the fact that o1 always throws "heads" could indicate that it "knows" what randomness is, and is then just being random by throwing only heads.

I personnaly would define ideal randomness as a behavior that is fundamentally uncomputable and/or cannot be expressed as a mathematical function. If this definition holds than the question cannot apply to LLMs as they are a just (big) mathematical function.

naghing•10mo ago
Why not provide randomness to LLMs instead of expecting them to produce it?
edding4500•10mo ago
This is silly. Behind an LLM sits a deterministic algorithm. So no, it is not possible without ibserting randomness by other means into the algo, for example by setting temperatures for gradient descent.

Why are all these posts and news about LLMs so uninformed? This is human built technology. You can actually read up how these things work. And yet they are treated as if it were an alien species that must be examined by sociological means and methods where it is not necessary. Grinds my gears every time :D

alew1•10mo ago
The algorithms are not deterministic: they output a probability distribution over next tokens, which is then sampled. That’s why clicking “retry” gives you a different answer. An LM could easily (in principle) compute a 50/50 distribution when asked to flip a coin.
aeonik•10mo ago
They are still deterministic. You can set temperature to zero to get the output to be consistent, but even the temperature usually uses a seed or psuedo random number generator. Though this would depend on the implementation.

https://github.com/huggingface/transformers/blob/d538293f62f...

orbital-decay•10mo ago
Setting the temperature to zero reduces the process to greedy search, which does a lot more things to the output than just making it non-random.
dist-epoch•10mo ago
As someone which tried really hard to get deterministic outcome out of them, they really are not.

Layers can be computed in slightly different orders (due to parallelism), on different GPU models, and this will cause small numerical differences which will compound due to auto-regression.

throwawaymaths•10mo ago
all things being equal, if you fix all of those things and the hardware isn't buggy, you get the same results, and I've set up CI with golden values that requires this to be true. indeed, occasionally you have to change golden values depending on implementation but mathematically the algorithm is deterministic, even if in practice determinidm requires a bit more effort.
dkersten•10mo ago
But the reality is that all things aren’t equal and you can’t fix all of those things, not in a way that is practical. You’d have to run everything serially (or at least in a way you can guarantee identical order) and likely emulated so you can guarantee identical precision and operations. You’ll be waiting a long time for results.

Sure, it’s theoretically deterministic, but so are many natural processes like air pressure, or the three body problem, or nuclear decay, if only we had all the inputs and fixed all the variables, but the reality is that we can’t and it’s not particularly useful to say that well if we could it’d be deterministic.

orbital-decay•10mo ago
It's definitely reachable in practice. Gemini 2.0 Flash is 100% deterministic at temperature 0, for example. I guess it's due to the TPU hardware (but then why other Gemini models are not like that...).
throwawaymaths•10mo ago
Anyways, this is all immaterial to the original question, which is if LLMs can do randomness [for single user with a given query], so from a practical standpoint the question itself needs to survive "all things being equal", that is is to say, suppose I stand up an LLM on my own GPU rig, and the algorithmic scheduler doesn't do too many out of order operations (very possible depending on the ollama or vllm build).
delusional•10mo ago
Could someone elighten me on how to compute layers in parallel? I was under the impression that the linearity of the layer computation was why we were mostly bandwidth constrained. If you can compute the layers In parallel then why do we need high bandwidth?
dist-epoch•10mo ago
https://developer.nvidia.com/blog/mastering-llm-techniques-i...
im3w1l•10mo ago
Yes so it's basically asking whether that probability distribution is 50/50 or not. And it turns out that it's sometimes very skewed. Which is a non-obvious result.
throwawaymaths•10mo ago
i think gp would consider the sampling bit a part of the API, not a part of the algorithm.
kurikuri•10mo ago
So, what ‘algorithms’ are you talking about? The randomness comes from the input value (the random seed). Once you give it a random seed, a special number generator (PRNG) makes a sequence from that seed. When the LLM needs to ‘flip a coin,’ it just consumes a value from the PRNG’s output sequence.

Think of each new ‘interaction’ with the LLM as having two things that can change: the context and the PRNG state. We can also think of the PRNG state as having two things: the random seed (which makes the output sequence), and the index of the last consumed random value from the PRNG. If the context, random seed, and index are the same, then the LLM will always give the same answer. Just to be clear, the only ‘randomness’ in these state values comes from the random seed itself.

The LLM doesn’t make any randomness, it needs randomness as an input (hyper)parameter.

orbital-decay•10mo ago
The raw output of a transformer model is a list of logits, confidence scores for each token in its vocabulary. It's only deterministic in this sense (same input = same scores). But it can easily assign equal scores to 1 and 0 and zero to other tokens, and you'll have to sample it randomly to produce the result. Whether you consider it external or internal doesn't matter, transformers are inherently probabilistic by design. Randomness is all they produce. And typically they aren't trained with the case of temperature 0 and greedy sampling in mind.
kurikuri•10mo ago
> But it can easily assign equal scores to 1 and 0 and zero to other tokens, and you’ll have to sample it randomly to produce the result. Whether you consider it external or internal doesn’t matter, transformers are inherently probabilistic by design.

The transformer is operating on the probability functions in a fully deterministic fashion, you might be missing the forest for the trees here. In your hypothetical, the transformer does not have a non-deterministic way of selecting the 1 or 0 token, so it will rely on a noise source which can. It does not produce any randomness at all.

orbital-decay•10mo ago
It's one way to look at it, but consider that you need the noise source in case 1 and 0 are strictly equal, necessarily. You can't tell which one is the answer until you decided randomly.
kurikuri•10mo ago
Right, so the LLM needs some randomness to make that decision. The LLM performs a series of deterministic operations until it needs the randomness to make this decisions, there is no randomness within the LLM itself.
kbelder•10mo ago
But the randomness doesn't directly translate to a random outcome in results. It may randomly choose from a thousand possible choices, where 90% of the choices are some variant of 'the coin comes up heads'.

I think a more useful approach is to give the LLM access to an api that returns a random number, and let it ask for one during response formulation, when needed.

_joel•10mo ago
Deterministic with a random seed?
edding4500•10mo ago
But then the random seed is the source of randomness and not the training data. So the question "Can LLMs do randomness" would actually boil down to "Can PRNGs do randomness".
kerkeslager•10mo ago
The algorithms are definitely not deterministic. That said I agree with your general point that experimenting on LLMs as if they're black boxes with unknown internals is silly.

EDIT: I'm seeing another poster saying "Deterministic with a random seed?" That's a good point--all the non-determinism comes from the seed, which isn't particularly critical to the algorithm. One could easily make an LLM deterministic by simply always using the same seed.

dist-epoch•10mo ago
> all the non-determinism comes from the seed

not fully true, when using floating point the order of operations matters, and it can vary slightly due to parallelism. I've seen LLMs return different outputs with the same seed.

onionisafruit•10mo ago
That’s an interesting observation. Usually we try to control that, but with LLMs the non-determinism is fine.

It seems like that would make it hard to unit test LLM code, but they seem to be managing.

kerkeslager•10mo ago
Oh, that's really interesting. Hadn't thought of that.
chaoz_•10mo ago
"You can actually read up on how these things work."

While you can definitely read about how some parts of a very complex neural network function, it's very challenging to understand the underlying patterns.

That's why even the people who invented components of these networks still invest in areas like mechanistic interpretability, trying to develop a model of how these systems actually operate. See https://www.transformer-circuits.pub/2022/mech-interp-essay (Chris Olah)

kaibee•10mo ago
Yes, but sometimes asking dumb questions is the first step to asking smart questions. And OP's investigation does raise some questions to me at least.

1. Give a model a context with some # of actually random numbers and then ask it to generate the next random number. How random is that number? Repeat N times, graph the results, is there anything interesting about the results?

2. I remember reading about how brains/etc are kinda edge-balanced chaotic systems. So if a model is bad at outputting random numbers (ie: needs a very high temperature for the experiment from step 1 to produce a good distribution of random numbers) What if anything does that tell us about the model?

3. Can we add a training step/fine-tuning step that makes the model better at the experiment from step #2? What effect does that have on its benchmarks?

I'm not an ML researcher, so maybe this is still nonsense.

whoami_nr•10mo ago
Author here. I know it’s silly. I understand to some extent how they work. I was just doing this for fun. Took about 1hr for everything and it all started when a friend asked me whether we can use them for a coin toss.
edding4500•10mo ago
Sorry, I did not mean to downtalk the blog post :) I did not mean silly as in stupid. It's rather the title that I think is misleading. Can a LLM do randomness? Well, PRNGs are part of it so the question boils down whether PRNGs can do randomness. As mentioned here before, setting the temperature of say GPT-2 to zero makes the output deterministic. I was 99% sure that you as the author knew about this :)
boroboro4•10mo ago
It would be nice to inspect logits data/distribution. How close the output of it to uniform is the question.
david-gpu•10mo ago
During my tenure at NVidia I met a guy that was working on special versions of to the kernels that would make them deterministic.

Otherwise, parallel floating point computations like these are not going to be perfectly deterministic, due to a combination of two factors. First, the order of some operations will be random due to all sorts of environmental conditions such as temperature variations. Second, floating point operations like addition are not ~~commutative~~ associative (thanks!!), which surprises people unfamiliar with how they work.

That is before we even talk about the temperature setting on LLMs.

enriquto•10mo ago
> floating point operations like addition are not commutative

maybe you meant associative? Floating point addition is commutative: a+b is always equal to b+a for any values of a and b. It is not associative, though: a+(b+c) is in general different to (a+b)+c, think what happens if a is tiny and b,c are huge, for example.

david-gpu•10mo ago
Sorry, yes, I meant associative. Thanks for the important correction.

To think that I used to do this for a living...

simulator5g•10mo ago
How is that any different? 1+(2+3) = 6

(1+2)+3 = 6

0.000001+(200000+300000) = 500000.000001

(0.000001+200000)+300000 = 500000.000001

david-gpu•10mo ago
You need to take it a step further, since e.g. 64-bit floats have a ton of mantissa bits.

Here's an example in python3.

    >>> "{:.2f}".format(1e16 + (1 + 1))
    '10000000000000002.00'
    >>> "{:.2f}".format((1e16 + 1) + 1)
    '10000000000000000.00'
enriquto•10mo ago
take b and c with opposite signs
ganiszulfa•10mo ago
LLMs are acting like humans, I believe humans will have biases if you ask them to do random things :)

On a more serious note, you could always adjust the temperature so they behave more randomly.

mrdw•10mo ago
They should measure for different temperatures, where at 0 it will be the same output every time, but it's interesting to see how results will change for different temperatures from 0.01 to 2. But, I'm not sure if temperature is implemented the same way in all llms