SShortSingh.
Back to feed

Heterodyne diffs quantized and full-precision LLM runs token by token and layer by layer

0
·1 views

A developer found that a Q4_K_M quantized Qwen3-0.6B model disagreed with its BF16 version on a Python primality-check completion, flipping the prediction, and wanted to know where the divergence arose. Aggregate metrics like KL divergence and perplexity showed the drift but not which tokens, layers, or components caused it. They built heterodyne, a tool that runs two llama.cpp configurations on identical tokens and compares outputs and per-layer residual streams. It also performs activation transplants to test which layers carry the difference to the output. Because it operates inside llama.cpp's own kernels, it measures the GGUF models users actually deploy rather than dequantized PyTorch approximations.

Read the full story at DEV Community

This is an AI-generated summary. ShortSingh links to the original source for the complete article.

Discussion (0)

Log in to join the discussion and vote.

Log in

Related stories

0
ProgrammingDEV Community ·

DukaanAI: Open-Weight AI Tool Generates Ads for Small Indian Shops

A developer has built DukaanAI, a Python application that helps local shop owners create product advertisements from short text prompts. The tool accepts requests in English, Hindi, and Marathi and is aimed at small retailers and home-based sellers who lack time or budget for marketing. It uses the Groq API to run the openai/gpt-oss-20b open-weight model, with the output displayed in the terminal. The project is at an early stage and is not yet deployed, and the developer has not confirmed any real-world users or payments. The next planned step is to test it with a local shop owner and refine the ads based on feedback.

0
ProgrammingDEV Community ·

NAT Gateway vs VPC Endpoints: Choosing the Right Path for Private AWS Subnets

A new guide explains how workloads in AWS private subnets can reach other systems without exposing themselves to inbound internet traffic. It contrasts NAT Gateways, which handle outbound internet-bound requests such as software updates and public API calls, with VPC endpoints that provide private routes to AWS services. Using an EC2 instance that needs to upload files to Amazon S3 as an example, the article shows how an S3 Gateway Endpoint can take precedence over the default NAT route through a more specific prefix-list entry. It notes that Gateway Endpoints carry no additional usage charge, while NAT Gateways incur hourly and per-gigabyte fees. The piece emphasizes routing each traffic type to the appropriate path to balance connectivity, security, and cost.

0
ProgrammingDEV Community ·

HustleKit AI: An AI Workspace for Solo Online Sellers' Marketing and Growth

A developer has built HustleKit AI, an AI-powered workspace aimed at solo online sellers, indie makers, and creator-led businesses. The platform combines product marketing copy generation with sales analytics and structured growth recommendations in one dashboard. Its Growth Advisor runs a four-step workflow that loads business data, builds evidence from sales metrics, generates recommendations with the Gemma 3 12B model, and validates the output against a schema before saving. The application uses a full-stack TypeScript architecture with React, Node.js, MongoDB Atlas, and Mastra, and the project is publicly available online with its source code on GitHub. The developer reported that the backend test suite passed 49 tests across six suites.

0
ProgrammingDEV Community ·

Why long-lived JWTs stay valid after theft and how refresh token rotation helps

A stateless JWT is checked only by its signature and expiry, so a stolen token stays usable until it expires even after a password change. Shortening access token lifetimes alone hurts user experience, so applications pair short-lived access tokens with longer-lived refresh tokens. Rotation issues a new refresh token on every refresh, letting servers detect when an already-used token reappears and revoke the affected session. The approach also raises practical issues such as network retries mistaken for theft, simultaneous browser tabs, and sessions that never expire, which require careful design. Storing the refresh token in an httpOnly secure cookie and the access token in memory further limits exposure.

Heterodyne diffs quantized and full-precision LLM runs token by token and layer by layer · ShortSingh