Better HN
topnewbestaskshowjobs
Log inSign up

mmastrac

50,340 karma · joined Jul 3, 2007 (19y ago) · 4,689 submissions

Matt Mastracci

Playing with fun tech.

  Mastodon: @mmastrac@hachyderm.io (https://hachyderm.io/@mmastrac)
  Email me: matthew@mastracci.com
  LinkedIn: https://www.linkedin.com/in/matthewmastracci/
Submissions

comment 18h ago · link · parent

Interesting - we've been working on something similar, but found that calibration on the full sessions, but with the bit allocation on model-written tokens only was the most successful approach. I'll have to see if it improves our output if we weight error only on model-written tokens, but from my experiments it seemed that this was getting us the best results in terms of KL.

Our approach might be slightly different however, as we encode multiple bit widths and then select per-profile manifest with the lowest KL we can solve at a given size using the per-expert/layer encoded chunks. The most recent quantization run we did for GLM 5.3 has some of the numbers and all of the slices as well.

https://huggingface.co/kindlingai/glm-5.3-exlr8-k2-k3-k4

Appreciate the response. Happy to chat more. I did find the paper with a bit more info and I'll have to see if there's anything we can learn from your approach!

comment 23h ago · link · parent

I put this together to hopefully better help show what goes on...

https://quantwiki.kindlingai.dev/codebooks/mul1

(claude assisted, obviously!)

And yes, hah, that blog has been through a long, long number of years.

comment 1d ago · link · parent

The trellis quants basically rotate the weights in a way so you end up with something that looks like Gaussian noise, then do a search over the optimum set of bits to encode that noise. What you end up with is a close approximation to the old weights (up to a certain point), but with the energy of the values "shaved".

You lose the fine detail but keep the higher structure. Models are generally pretty resilient to it, especially larger ones. An over-quantized model tends to lose fine detail in its knowledge, lose some ability to track/accumulate accurately, and occasionally loops (because the activations are rounded off too much and lose energy, and it gets trapped in a state where it just can't escape).

When you quantize you try and get as big of a mix of calibration data as possible. You don't need to match the training _set_, just enough data that you exercise 99.999% of the most well-trod paths through the model. Anything outside of the calibration set is a crap-shoot as to whether it gets kept or not, but a well-balanced calibration set will keep performance near-unquantized.

On what calibration does: during quantization you try to minimize the error between the run of the model with original weights and the run of the model with the quant'd weights. Calibration data lets you weight the error away from the paths that are actually chosen with real data.

Apologies, this is a bit of a hand-wavey comment but it's sort of how you can look at it without needing to deal with the hairier math.

comment 1d ago · link · parent

EDIT: I'm not sure why there's downvotes here - if you purport to come out with a new quantization format and it's not front-and-center what your inspiration and trellis are, that's a bit of a red flag (and especially any comparison to the mul1 codebook that it's evolved from).

Its seems unnecessarily hard to understand what NariQ is, but it appears to be a derivative of exl3's mul1 with k1-k6, costing ~2 IMAD + 2 LOP3 + 2 IDP + 1 pack IMAD. It's not a real half-width codebook, just averaging k2/k3 to make k2.5? Happy to see someone else discovering the integer addition tricks too.

FWIW in exlr8 we added a pmcgx codebook that likely does better than this at low bitrates, and has a real half-bit (it's pairwise so you can feed an odd number of bits to it). Our team just finished a quant on Qwen 3.8 flash next, but I might be able to spin one up on Qwen3.8-27B to do a direct head-to-head.

Ran a quick head-to-head on some pseudo weights via Claude too:

- NariQ's codebook comes out within ±0.3% of mul1 on every site. Neither of its two changes matters much at K2: the 6-bit digits and the skipped E4M3 rounding each move the error by about 0.1%.

- pmcgx L20 has 1.1% to 3.1% less error than mul1, so it beats NariQ by about the same margin.

Update:

- NariQ looks slightly better from K4-K6 f16 trellis (barely losing to mul1, which is the king there)

Side-by-side codebooks:

  mul1(s):                         nariq(s):                        pmcgx(w):   # w = 20-bit state, 2 values
    x = s * 0x83DCD12D               x = s * 0x83DCD12D               x1 = w * 0xCBAC1FED
    t = sum(bytes(x))                t = sum(bytes(x) >> 2)           x2 = w * 0xBCA14C51
    v = fp16(1024 + t)*c + d         v = t - 126                      m1 = (x1 & 0x8FFF8FFF) ^ 0x3B603B60
    return e4m3(v)                   return v      # int, exact       m2 = (x2 & 0x8FFF8FFF) ^ 0x3B603B60
                                                                    a  = fp16(m1.lo) + fp16(m2.hi)
                                                                    b  = fp16(m1.hi) + fp16(m2.lo)
                                                                    return e4m3(a), e4m3(b)

5.

XNU Linux: Full OS X GUI Userspace on Linux(github.com ↗)

619 points · by mmastrac · 1d ago · 265 comments

comment 1w ago · link · parent

I blogged about this earlier this year - I think they reached out to me as part of my crate work and tried to get me to download a booby-trapped repo with a remote shell.

Insidious attack, it felt very real, they had a compelling fake network of sites and companies

comment 3w ago · link · parent

It's definitely pair damage, but could also be a drill or other nick (ie: making potlight holes), or even stapled wire.

Recrimping is always the best first step. Sometimes running 2.5gb instead of gigabit will help too.

comment 4w ago · link · parent

(this is just made up tokenization but it's close enough to the real world)

If the user types <tool_call>, you get < (token id = 32), tool_call (41), > (102). It never decodes to <tool_call>, which is spicy number 12345, for example.

The tool call tokens are _always_ composed of multiple real tokens, so you can never get them from normal text.

Seeing <tool_call> is a bit misleading because that's just a debug rendering if anything. The front-end sees a special number and knows it's a toolcall. The chat template uses that text form because it's easier than writing the spicy numbers there, but it also has a special parsing mode for those.

comment 4w ago · link · parent

They are a special token that you can't just type out in text. It _renders_ as text, but cannot be input into the system as text. The model understands the difference between the textual toolcall token and the "special" one that's really just a spicy number.

comment 4w ago · link · parent

Yes, absolutely. The problem is integrating it into the inference engine. Not impossible, just _very hard_.

comment 4w ago · link · parent

Amusingly constrained decoding is the same approach we use to turn an AR model into a /v1/systemone endpoint (I worked on the vLLM feature).

Tool calling is fraught with peril, especially because there's nothing that necessarily says that a models tools are fixed in place for the life of its run. In some cases, tools are added mid-run to avoid a giant prefix miss and (at least last time I checked!), the industry has not settled on OpenAI-style chat message formats for tool call updates.

I would absolutely prefer to run in a fully-constrained tool call environment, and would love if we hadn't YOLO'd the whole thing! The PTC-style tools sort of fix this by punting tool calling to JavaScript, but that's even harder to enforce, and models not trained on the style might take a turn of failed tool calls to get it right.

comment 1mo ago · link · parent

There are some interesting gaps in the proofs. Where did 045 go?

comment 1mo ago · link · parent

That's not true. I ran Cerebras as an experimental ultrafast Jev and it was faster.

comment 2mo ago · link · parent

Nice. I saw some git-on-durable-objects projects but I'd so much prefer a straight object storage option.

comment 2mo ago · link · parent

I'd be interested to see if using DiffusionGemma-as-Jev helps as you can feed the image directly into the model and it'll make decisions based on the image embeddings.

comment 2mo ago · link · parent

I suspect you could get interesting results, but DiffusionGemma has a lot of knowledge that may be challenging to train into the smaller models. The advantage of pulling a fully-trained diffusion model off the shelf is that it already knows all of this, has been trained as a MoE, etc.

What I think these models actually need is a structured decision thinking mode. As it stands now, the only way to think about the answers with DiffusionGemma is to diffuse a thinking block, but giving the model an auto-regressive thinking space to reason, even just lightly, could drastically improve performance.

comment 2mo ago · link · parent

I believe you get better answers by diffusing each question together, but the PR's server gives you finer control over that. If each question is independent, you can get better parallelism.

18.

Near-real-time vision using DiffusionGemma in Jev mode(twitter.com ↗)

3 points · by mmastrac · 2mo ago · discuss

comment 2mo ago · link · parent

If you want to try a _legit_ Jev implementation that matches (at least in my evals), the vLLM patch to turn DiffusionGemma into Jev is available.

On my DGX Spark I get very similar latency numbers, and it matches my evals + or - a few points on each test (DG wins some, Jev wins some, both show low confidence when wrong).

I ran the same evals against a Qwen36 and it clearly lost to both of them, so you are leaving both knowledge and instinctual reasoning on the table with any smaller models, FWIW.

https://github.com/vllm-project/vllm/pull/57250

comment 2mo ago · link · parent

That's a rough place to land on a spark. It seems unlikely to be memory bandwidth at this model size, but maybe just lack of tuned kernels? The chip is missing some CUDA features but with tuning you should be able to hit way more than that even without a drafter.

comment 2mo ago · link · parent

Send me an email- it's not public just yet

comment 2mo ago · link · parent

I've been working with an automatic incremental context compactor enabled and it's been surprisingly helpful. It was particularly effective with DS41f - I think I was running at an effective session length of 5M, with the model running around 300k-400k and it was holding on both speed and intelligence.

TBH I also ran the 400tok/s preview and that was just nuts. I just let the thing compact over and over over the course of a day attacking a couple of tough problems

comment 2mo ago · link · parent

Any diffusion model is potentially a Jev in disguise: https://github.com/vllm-project/vllm/pull/57250

Runs ~0.2s per decision on my DGX Spark.

  10/10 programming language detection
  9/10 human language detection
  10/12 unit magnitude comparison
All incorrect answers are marked with low-P.

It (DiffusionGemma with the Jev mode) can also solve an ASCII maze.

24.

vLLM: Jev-like mode for the DiffusionGemma model(github.com ↗)

1 points · by mmastrac · 2mo ago · discuss

comment 2mo ago · link · parent

Is this a Markov/Diffusion model with some sort of external Engram memory? If so, this could be extremely interesting.

comment 2mo ago · link · parent

Andon Cafe:

Revenue: 13 933 kr

Token Cost: 14 882 kr

.. and a bastardization of the old Twitter joke:

"I told our CEO that our cafe keeps hitting its token spending limit but not making money. So I asked where he gets the tokens, and he said he just buys more credits from the console afterwards. So I said it sounds like he's building a machine to feed dollars to Anthropic, and then our data scientist started crying."

comment 2mo ago · link · parent

It's "load bearing".

comment 2mo ago · link · parent

magnet:?xt=urn:btih:67177297E84766DFBF1C9EAAC6CF44B6F40BF3D1

I haven't checked it out myself but I've heard that some posts were removed from this magnet.

comment 2mo ago · link · parent

This is one of the best references on this topic I've seen - run cycles and foot locking are annoyingly lacking in documentation outside a few papers.

comment 2mo ago · link · parent

I'm using DSH with my local models (4x sparks running GLM53F, trying them on DS41F this morning). DSH is better than opencode IMO. It's a little barebones out of the box but I guess that's the point. I had to have an agent add support for attachments to make it more useful for multi-modal work.

The PTC mode is pretty nice. Feels like models are still learning how to navigate it.

12345
157