How to read frozen weights without a forward pass A systems engineer published a guide showing how to inspect a frozen model's stored weights — tensor bytes, tokenizer strings and architecture wiring — directly from a SafeTensors file without loading a runtime or running a forward pass. The guide separates three layers: source data and architecture wiring traceable to exact byte spans, full-space measurements such as the cosine between two 1,024-element embedding rows, and display structures like 2D or 3D coordinates that do not exist inside the checkpoint. It notes that in tied-embedding models such as Qwen 3.5 the input and output vocabulary tables are the exact same bytes. When I showed my frozen model viewer, someone asked where the names and edges even came from. Someone else asked how I could map weights to behavior without running the model. Those are two different questions, and I hadn't made clear which one I was trying to answer. After building that viewer, I noticed it isn't widely known how much structure you can read straight from a frozen model before a runtime ever touches it. I'm not writing this to argue, or to claim that a spatial geometric view is equal to a behavioral one. I'm sharing a practical way to read what is stored in the frozen weights, follow how tensors connect across the blocks, and show that all that traces back to the raw bytes. In the hopes it well be valuable to you. So, here's the thing. You do not need to run a model to explore the geometry of its stored parameters, or walk its wiring. What you need is to choose a checkpoint to read, the model's matching tokenizer so you can display token names , a way to create an architecture map so you can know which parts connect, and finally, a way to measure the things I explain here, mechanically. This guide is my attempt to walk you through how to go from a byte offset in a SafeTensors file to a token neighborhood graph, a 3D map, and a cross-layer weight walk, all without needing to load a model runtime or a forward pass. Before we begin, it is important to understand that I come at this as a systems engineer working at the architecture and data-structure level, not the runtime level. And because my interest has always been in the data and data structures themselves, the language I use is likely more mechanical than what you might be used to in other machine learning posts. When I describe something in terms of byte spans, array axes, or structural nodes, don't read that as me being vague: treat it more as me trying to be exact about what is actually stored on disk, and not from a runtime calculation perspective. Before doing anything, I want to know what is in the file I am working on and if I can trace every visual element back to its bytes. So when you look at a frozen model for the first time, those are the parts you should be interested in. I'd say you can view it as three strictly separate layers: 1. Source data and architecture wiring: The raw tensor bytes in the file, the token strings in the tokenizer table, and the architecture rules that say which tensor dimensions connect to which. When an edge represents a stored weight, you can point to its tensor, row, column, and an exact byte span. 2. Derived full-space measurements: Numbers computed directly from those stored arrays at their full width, such as the cosine between two 1,024-element embedding rows. 3. Display structures: The 2D or 3D coordinates, bounding hierarchies, and screen layouts built so a human can move around the data without altering it. None of these pictures exists inside the checkpoint file. That separation gives you three rules when reading the map: - A measured similarity edge means two stored rows have a reported cosine in their full-width array space. - Two nearby dots on screen only mean two rows landed near each other after projecting down to 2D or 3D. Check their full-width score before trusting screen proximity. - A structural wiring edge means the architecture connects one array axis, weight, or stage to the next. By itself, it says nothing about how much signal moved across that connection during a runtime execution. My starting point was simple: when a model isn't running, everything it knows has to sit somewhere in its weights. Looking at the arrays mechanically, and realizing inference must be a chain of offsets applied to a carried vector from block to block, and at the end especially in a tied-embedding model like Qwen 3.5, where the input and output vocabulary tables are the exact same bytes , the final vector is compared back against those token rows. Mechanically, it made sense that a vector's angle direction would be what associates with a token, since layer-by-layer execution works by offsetting and rotating that direction, while the magnitude length affects how strongly each contribution pulls. To test this, I separated the magnitudes from the angles to make them more observable. And then I tested that split with paired probes across all 24 layers of the Qwen 3.5 0.8B model I had been working on, the separation was stark: - Direction alone identified which token was present 99.6% of the time across all layers against a 14.3% random baseline . - Magnitude alone identified the token only 31.3% of the time. And across 480 layer observations with different surrounding context, the context never once flipped a token's direction 0 / 480 reversals; simple prompt + token addition also failed with 0.9038 relative error . What happened instead was, when multiple paths met at a shared intersection, their relative incoming magnitudes damped the radius and rotated the combined resultant into a context-conditioned cone, before realigning toward the output table at the final block. Direct weight interventions showed the same split statically: scaling 16 complete gate proj rows across layers 0, 7, 15, 23 by 0.25x and 4.0x changed 0 / 16 nearest-token owners, whereas rotating them halfway toward 'ĠRust' at constant norm changed all 16 / 16 . Two other mechanical observations while inspecting Qwen 3.5 0.8B pushed me the rest of the way toward building the spatial viewer I shared before: 1. Weights step from layer to layer by 90 degrees + a small delta : When I measured corresponding projection rows gate , up , QKV , Z from one layer to the next, the angle consistently shifted by 90 degrees plus or minus a small signed delta roughly 89° to 90° , within a tight ~ 2° band . Think of it mechanically like a physical ring indexing one quarter-turn per layer, plus a small signed offset that carries the specific adjustment onto the next axis. Whether the math says 90° is expected in high dimensions is not the point. Mechanically, it means moving from layer to layer isn't an untraceable black-box scramble: it follows a deterministic, observable stepping rule quarter-turn + signed delta , paired with radius that can be understood causally and exploited directly, for instance by stepping a single resident layer buffer in place from layer to layer instead of holding 18 separate linear layers as unrelated blobs. 2. Rotational activity concentrates late, especially around layer 18: Qwen 3.5 0.8B is built from a repeating 3 linear-attention + 1 full-attention block pattern across its 24 layers 0..2 - 3 , 4..6 - 7 , 8..10 - 11 , 12..14 - 15 , 16..18 - 19 , and 20..22 - 23 . Watching both token-matched gate angles and accumulated block deltas across those six cycles, the directional shifts and norm buildup weren't spread evenly across all layers: most of the heavy rotational shift concentrated around layer 18 the fifth 3 + 1 cycle, 16..18 - 19 , right before the final 20..23 block makes the large closing turn toward the output table. Put those pieces together and you can see why a flat tensor dump wasn't enough, and why a frozen spatial explorer makes sense structurally: - Angle carries identity and membership , and those frozen directions and shared intersections are already sitting in the checkpoint file at rest. - Layer transitions follow a deterministic mechanical step 90° + delta onto the next axis, while individual coordinates share superposed paths , so structure across depth is something you can trace and index as a space rather than treating layers as disconnected black boxes. - Live magnitude belongs to the runtime: when a prompt executes, incoming magnitudes at shared intersections weight, damp, and rotate the resultant across that static structure. Typically, I start with the smallest concrete question: where does one weight live inside the file? Once you can compute that address, you can read one scalar or one row on demand without loading a multi-gigabyte checkpoint into RAM. A SafeTensors file is a flat binary container. It starts with an 8-byte unsigned little-endian integer N giving the byte length of a UTF-8 JSON header, followed immediately by N bytes of JSON. The raw tensor payload starts at byte 8 + N . Each entry in the JSON header gives a dtype , a shape array, and a half-open byte range data offsets: start, end relative to the start of the payload , not to byte zero of the file. For a dense, row-major 2D matrix with C columns and B bytes per element: tensor start = 8 + N + start row start = tensor start + row C B scalar start = row start + column B Validate the rank, shape, dtype, file bounds, and exact byte span end - start == rows C B before seeking. Then read B bytes for a single weight or C B bytes for a row. F32 is a 4-byte little-endian IEEE float. BF16 is 2 bytes: read them as a 16-bit little-endian unsigned integer, shift the bits left by 16, and reinterpret those 32 bits as F32 . That decodes the exact stored BF16 value; it does not invent precision that wasn't saved in the file. To look up a token's row, find the input embedding table declared by the architecture. A tensor name like model.embed tokens.weight or model.language model.embed tokens.weight is a hint, not a guarantee: always confirm its role and vocab slots, hidden width shape against the model layout. In that layout, integer token ID t indexes row t . Join those row indices against the matching tokenizer.json model.vocab and added tokens . Don't assume every row in the embedding array has a token string: checkpoints often pad vocab slots up to an alignment boundary, leaving unused rows at the end of the table. Keep exact integer IDs, whitespace, and special-token metadata intact. A raw vocabulary key is also not always final display text: byte-level BPE stores markers such as Ġ for a leading space 'ĠRust' vs 'rust' or raw byte tokens. Keep the raw key accessible so distinct rows don't get collapsed under the same label. Once you can read two rows of equal width from the same table, you can measure how closely they point in the same direction. Treat embedding row e t as a fixed-length array of D numbers. Divide each nonzero row by its Euclidean length to get its unit direction u t : cosine a, b = dot e a , e b / norm e a norm e b = dot u a , u b +1 is the same direction, 0 is perpendicular, and -1 is opposite. Normalizing splits direction away from length on purpose: 1, 0 and 10, 0 both have unit direction 1, 0 and score 1 . Because direction is what carries almost all token identity while magnitude acts as radial weight when vectors combine, a good data model stores unit direction and magnitude as two separate fields rather than mixing them or throwing length away silently. Keep the static claim clean too: cosine measures directional alignment between two stored rows, not synonymy and not how much live magnitude will arrive in a given prompt. To inspect one token's neighborhood, normalize its row, stream sequentially across the embedding table on disk or in a buffer, and maintain a fixed-size min-heap of the top k scores. Skip the query ID itself, skip zero or non-finite rows, and skip unmapped padding rows if you only want valid tokens. Break ties deterministically by integer token ID so two implementations always return the exact same neighbor list. Connecting a query token to its top k neighbors gives you a simple hub. If you also compute cosines between those k neighbors, you can see whether the local web breaks into distinct pockets say, lowercase/uppercase variants on one side and related domain terms on another . If you want stricter grouping across a larger set, keep edges only where two tokens appear in each other's top k mutual nearest neighbors , and test a few values of k so an arbitrary cutoff doesn't fool you. Data-structure-wise, a single query scan costs O V D multiply-adds over V rows of width D plus O log k heap updates when a row enters the top k . You never need to allocate a V V matrix. If you later put an approximate index in front of the table, mark those results as approximate and recompute exact cosines from the source rows for anything you display. Tables of cosines are exact, but hard to browse. To put tens or hundreds of thousands of token roots on screen, you need a deterministic way to map D numbers down to three coordinates x, y, z . A simple one-pass method of doing that is to pick three independent rows from the table as anchors and orthogonalize them with Gram-Schmidt: from each anchor, subtract its dot-product projections onto the previous axes, then normalize the remainder. That yields three perpendicular unit axes axis x, axis y, axis z of width D . Every unit row u then projects to three numbers: p u = dot u, axis x , dot u, axis y , dot u, axis z In my Rust explorer, opening the checkpoint builds this basis from the first three present tokenizer IDs and writes a compact 8-byte display record for each present token root three signed 16-bit coordinates plus presence flags , then indexes those 3D points in a static bounding-volume hierarchy BVH . That way, camera orbit, pan, and frustum culling only traverse small integer bounds in RAM and never re-read the checkpoint. You could swap in PCA axes if you prefer axes aligned with table-wide spread, and nothing in the underlying source index would change. The main rule is to treat those 3D coordinates as lossy display state , never as source truth. Take a 4D example and keep only the first three slots: the unit vectors 0.6, 0, 0, 0.8 and 0.6, 0, 0, -0.8 both project to 0.6, 0, 0 , even though their actual 4D dot product is 0.36 - 0.64 = -0.28 . Screen layout is for navigation and culling; edges and scores must always come from the full-width vectors. For a local view centered on a chosen token q , put q at the origin and subtract q 's component from each normalized neighbor u : t = u - dot u, q q . Orthogonalizing three independent residual vectors t gives a local 3D basis showing the directions in which neighbors spread away from q . You can set distance from the origin directly from angle acos clamp cosine, -1, 1 , or space dense clusters out for label readability, as long as your UI keeps layout spacing separate from the measured cosine. Here is a minimal standalone reader using only the Python 3.10+ standard library drafted with AI assistance and checked against my Rust index . It parses the 8-byte SafeTensors header, validates the target tensor's byte span, optionally joins tokenizer.json keys so unmapped reserve rows are skipped, streams the rows once to build the 3-axis basis and top- k heap, and prints both full-width cosines and 3D coordinates. On a ~250k-row vocabulary in pure Python without NumPy, a full sequential scan takes roughly 10 to 20 seconds. python import heapq import json import math from operator import mul import os import struct import sys dot = getattr math, "sumprod", lambda a, b: sum map mul, a, b def read exact file, size : data = file.read size if len data = size: raise ValueError "truncated file" return data def unit v : length = math.hypot v if length == 0 or not math.isfinite length : return None inv = 1.0 / length return tuple x inv for x in v def load labels tokenizer path : with open tokenizer path, "r", encoding="utf-8" as file: tok = json.load file labels = {idx: key for key, idx in tok.get "model", {} .get "vocab", {} .items } for entry in tok.get "added tokens", : labels entry "id" = entry "content" return labels def inspect file, tensor name, query id, labels=None, k=8 : size = os.fstat file.fileno .st size header size = struct.unpack "