Posts in Javascript (20 found)
Ahead of AI Yesterday

Understanding Positional Embeddings in Modern LLMs

This article explains how LLMs encode and process token position information by covering classic and contemporary methods like RoPE. It’s essentially a comprehensive journey where we will work through the mechanisms with visual examples, a little math, and a small PyTorch implementation. And, of course, we will then also look at how modern architectures adapt or omit explicit positional encodings. Below, you can find a preview of which positional embedding choices are used in 2026 open-weight models. We will discuss these choices later after covering the underlying mechanisms. Figure 1: A preview of the gallery’s 2026 architectures, grouped by positional encoding. Architecture figures taken from my LLM gallery . But why spending so much time writing/reading about this rather minor building block? LLMs keep evolving, and as I was preparing a new article on the latest LLM architecture trends this year, I realized that I never covered the positional information methods used in LLMs in any article so far. So, instead of letting the other article get out of hand, I thought it might make sense to publish this as a standalone building block for the upcoming LLM architecture and trends analysis. Also, over the years, many readers have asked me for a tutorial on relative positional embeddings (aka RoPE) to follow up on the learned absolute embeddings used in GPT. It’s been on my TODO list for a long time, so I finally revisited my old draft and put this walkthrough together, which will cover different positional methods in LLMs; (finally) how RoPE works; what methods are used by recent open LLMs. Note that this article assumes some familiarity with basic LLM architectures and works well as a follow-up to Build a Large Language Model (From Scratch) . If the concepts and computation of the attention internals, particularly query, key, and value vectors, are a little fuzzy, I recommend checking my self-attention walkthrough as a refresher: The article is also very technical and likely too detailed for some. However, I really wanted to have this foundation out there for future articles to reference. And no worries, the next one will return to a more comfortable style. PS: I started experimenting with Substack’s new “perks” system. As a thank-you to supporters, I’ve added image exports and metadata from the architecture gallery for you to use in your own analyses. PPS: If you are already familiar with how position embeddings work, feel free to fast-forward to Section 6, Positional choices in modern architectures . Note that this article may be best read in a web browser than an email client. I recommend checking out the web view here , which also has a navigation bar on the left side. Let’s start with the overall architecture. A tokenizer encodes the input text into token IDs. Next, the input token embedding layer of an LLM maps each of these IDs to a vector of numbers. We usually refer to these entries in that vector as “features” (similar to classic ML). The transformer blocks inside the LLM then modify these vectors using attention and feedforward layers. Lastly, the model’s output layer produces logit scores (converted into probabilities) for the next token. The following shows this path in GPT-2 (a relatively classic LLM) and MiniMax-M3 (a more recent LLM released this year; a placeholder for most other recent LLMs). As we can see, the architectures are not too different from each other, but before we get to the positional information parts, let’s focus on the orange blocks for now (the token embedding layers) and the transformer blocks above them; the other architecture differences aren’t needed for this explanation. Figure 2: Token embedding layers in GPT-2 and MiniMax-M3, highlighted in orange. (Side note: M3’s first three out of 60 feedforward layers are dense not MoEs.) A token embedding layer, shown in the figure above, maps each token ID to a vector. Position information is then added afterward. Concretely, and as we will discuss in more detail later, GPT-2 adds a position vector to each token embedding before the modified embedding enters the first transformer block. On the other hand, MiniMax-M3 adds the positional information in each transformer block using a method called RoPE inside attention. We will talk about these methods in more detail later, but first, let’s start with the big picture information explaining why explicit positional information is added or needed. Consider the following two input sentences as a simple example: “The red fox jumps over the gray fox.” “The gray fox jumps over the red fox.” Changing the word order changes which fox does the jumping, as illustrated in the following figure. Figure 3: Changing the word order changes which fox jumps. For the examples in this article, we will treat each word as one token for simplicity. (As you know, real tokenizers can split words into smaller subword tokens.) The first sentence then has eight token positions, from 0 through 7. Figure 4: Token IDs and positions in the toy sentence. (If you are interested in how vocabularies are built, check out my tokenizer materials on GitHub .) Note that “fox”, which appears twice in the input sentence, gets the same token ID 2 in both cases. And since they both have the same token ID, irrespective of the position in the input sentence, they would get the same embedding vector from the embedding layer. Now, let’s consider a regular self-attention mechanism with no positional encoding (and no causal mask), where every input token can attend to every other token in the input. In this scenario, swapping any two words, like “red” and “gray”, would still result in the same embeddings and attention scores between each token pair. GPT-style models do use a causal (autoregressive) mask, which restricts each token to itself and earlier tokens. Interestingly, this causal mask gives the computation some implicit order information. In our example, “jumps” can attend to “red” in the first sentence and “gray” in the second. So, a causal LLM can theoretically already distinguish these sentences even without explicit positional embeddings. (We will return to this idea later when discussing the “NoPE” concept.) Nonetheless, GPT-2 and most newer LLMs include explicit positional information because it gives attention a direct signal about positions. That’s because even though the causal mask determines which tokens are accessible and provides implicit order information, it doesn’t distinguish a separation of one position from a separation of ten, for example. So, explicit positional methods are still useful (or even essential), since they supply that information. If this all sounded confusing, don’t worry, it was more meant as an overview, and we will step through these concepts a bit more slowly in the remaining article. We briefly talked about implicit positional information through causal attention masks (and we will revisit this again in more detail later). However, we now switch gears and talk about the explicit ways to add positional information. The perhaps simplest and most direct (but not “cheapest”) approach is to give each sequence position its own vector. We add that vector to the token embedding, so the resulting, modified embedding vector is then passed to the first transformer block. This exact procedure is discussed in the following subsections. To illustrate the use of an explicit, learned positional vector to the input embeddings, let’s consider GPT-2 as a concrete example. GPT-2 learns a table of position vectors during training. The following figure illustrates where these vectors are used in the architecture, that is, immediately after the token embedding lookup and before the first transformer block. Figure 5: GPT-2 adds absolute position information before the transformer blocks, as highlighted in purple. The dimensions shown are for GPT-2 XL . The positional embedding layer depicted in the figure above follows the same implementation as the token embedding layer, i.e., they have exactly the same output dimensions so that the resulting input vectors can be added to each other. The code below shows that with an excerpt of a GPT-2 code implementation: And in mathematical terms, we can write it as follows. Let m be a position index and x m the token ID at that position. The input to the first block is E token is the embedding layer, P m is the position info vector selected by m , and h m is the resulting summed embedding and position vector. The two vectors have the same width, so we add their entries element-wise. Figure 6 below shows this visually with a small numerical example. Figure 6: Token and position embeddings are added element-wise. (I am following the convention here that neural network diagrams are usually read from bottom to top.) In the figure above, at position 0, adding the token embedding to the position embedding gives . By the way, the values in the figure are chosen to keep the illustration simple; in a real example, both embedding layers (tables) are initialized with small random values and learned during training. So, what we covered in this section is a so-called absolute positional method because the positional embedding P m depends on the token’s own position m . In the previous example sentence, the two “fox” tokens have initially the same token embeddings, but because we are adding different positional vectors P 2 and P 7 , they have different values before they enter the first transformer block. And consequently, the query, key, and value vectors inside the attention mechanisms then also receive representations that already include position information. Note that the original GPT-2 implementation has 1,024 learned position vectors. This means it only works with inputs with 1024 or fewer tokens. If we want to extend the context window, we would have to extend this embedding table. And since the embedding table (layer) is updated like any other layer during training, the context length would have to be decided before the training starts. Extending the context would be very expensive since the table can become very large. For example, in the case of GPT-2 Medium, the positional embedding layer weights only make up 0.30% of the total weights at 1,024 positions. However, if we increased the context length to a nowadays common 100k range, they would make up >22% of the total model weights, which would be very uneconomic. The original “Attention Is All You Need” transformer from 2017, which predates GPT, uses the same addition mechanism, but computes its position vectors with fixed sine and cosine functions. Figure 7 below shows this addition before both the encoder and decoder stacks. The encoder processes the input sequence, and the decoder generates the output sequence. (The reason why it’s introduced here is that the sine and cosine functions will become relevant again later when discussing RoPE.) Figure 7: Sinusoidal position encodings added to the token embeddings as highlighted in purple. The original transformer also scales its token embeddings by √( d model ) before adding the position vectors, where d model is the embedding width. So, while GPT-2 in the previous section had the formula the formula used in the original transformer (depicted in Figure 7) is: This scaling by √( d model ) is a minor technical detail, but for those who are curious, the motivation behind this scaling factor is not explained in the transformer paper, but as I discussed with colleagues on a Twitter thread many years ago, it’s likely to put the token embeddings and sinusoidal positional encodings on comparable numerical magnitudes at initialization, so the position vectors don’t dominate the sum when we add them. In the GPT-2 case, this scaling wasn’t necessary because the original GPT-2 code initialized the token embeddings to have an initial standard deviation of 0.02 and the position embeddings to have an initial standard deviation of 0.01 so that they were already roughly on the same scale. Now, the more interesting point is how the position embeddings P m are computed. Concretely, each position vector has the following entries: As before, m denotes the position. The index i indexes a pair of features within the vector. Here, a feature is one number in the position vector. For example, let’s assume we have a small vector with 8 values ( d model = 8) that has entries numbered 0 through 7. (In the original paper this was 512 for the small model and 1024 for the bigger model, instead of 8, but that would be hard to visualize.) We group these into four pairs so that i goes from 0 through 3. Figure 8: Sine and cosine entries for each feature pair. Here, the indices 2 i and 2 i + 1 select the two entries corresponding to pair i . As shown in the equation earlier, the angle at position m , which is then fed into the sine or cosine functions to obtain P m , 2 i or P m , 2 i + 1 , respectively, is computed as follows: Figure 9: The angle inside sine and cosine is the token position multiplied by the pair’s angular frequency. Figure 10 shows this calculation for all four pairs of our 8-feature example at position m = 2. Figure 10: The four sine and cosine pairs at position 2. For an eight-feature embedding, the four frequencies are 1, 0.1, 0.01, and 0.001 radians per position. At position 2, the first pair in row 1 is (sin 2, cos 2) ≈ (0.909, −0.416). The second pair, in row 2, changes more slowly, giving (sin 0.2, cos 0.2) ≈ (0.199, 0.980). The figure below visualizes the sine and cosine calculations for different pairs, which are then collected in a position vector. Figure 11: Sampling sine and cosine functions to form a position vector. In short, this method is a (more complicated) alternative to obtaining positional embedding vectors compared to the GPT-2 method discussed earlier. Similar to the GPT-2 embeddings, these are also absolute embeddings because each vector is computed from its own position. However, in contrast to the GPT-2 approach, the sine and cosine functions stay fixed during training. (Also, they can be extended and evaluated beyond the training positions, like beyond the context length of 1024, although that alone doesn’t guarantee that the model will perform well there, because it hasn’t seen those during training.) To summarize, Figure 12 below compares the two ways of obtaining a position vector we discussed so far. Figure 12: Fixed sinusoidal and learned absolute positional embeddings. This sinusoidal method may look like an overly complicated way to obtain positional embeddings, however, understanding it will be useful when talking about RoPE in the next section. Also, there is some rationale behind it. The authors chose sine and cosine because they make the shifting by a certain offset gives a certain deterministic difference. For example, the difference between position 2 to 5 and the difference between 102 to 105 is both 3, which then results in the same rotation. According to the Attention Is All You Need paper: “...easily learn to attend by relative positions, since for any fixed offset k , PE pos + k can be represented as a linear function of PE pos .” Or in less technical terms, the authors hypothesized that this property would make it easier for attention to learn relationships such as “three tokens earlier.” Figure 13 below illustrates this for one sine/cosine pair. A rotation is a linear transformation, and both three-position shifts use the same rotation. Figure 13: For a pair with angular frequency 0.1 radians per position, a shift of three positions always rotates the pair by 0.3 radians. 3. Encoding relative position with RoPE So, the sinusoidal method above is still considered an absolute positional encoding because the vector added to each token embedding represents that token’s position counted from the start of the sequence. As shown in the previous figure, for example, tokens at positions 2 and 5 receive the position vectors P 2 and P 5 . If we move those tokens to positions 102 and 105, they’re still three positions apart. But each token gets a different position vector because its absolute position m has changed. So their attention score can change even when the token embeddings stay the same. The sinusoidal structure still gives the model a way to learn relative relationships. Anyways, RoPE, which we will discuss below, builds this relative relationship directly into the attention calculation. RoPE, which Su et al. introduced in the 2021 RoFormer paper , stands for Rotary Position Embedding and is considered a relative position method. In attention, each token’s current representation is projected into a query, a key, and a value vector. Query-key dot products determine attention scores. After masking and softmax, the resulting weights determine how the value vectors are mixed. For a refresher, see my Understanding and Coding Self-Attention, Multi-Head Attention, Causal-Attention, and Cross-Attention in LLMs article: RoPE uses the token’s position to rotate its query and key vectors before their dot product. The value vectors bypass this rotation. Figure 14 below shows an overview of where RoPE is applied in a relatively recent MiniMax-M3, where QK-Norm normalizes queries and keys before RoPE. Figure 14: MiniMax-M3 applies RoPE to queries and keys inside attention. As shown in the figure above, the LLM architecture has no explicit position vector added alongside the initial token embedding. Its explicit position signal is injected inside attention instead. Side note: MiniMax-M3 rotates only part of each query and key head, a variation known as “partial RoPE” that we will cover later in Section 6.1. But to understand the basic RoPE operation first, let’s walk through the method step by step using a small example. Attention usually divides its query, key, and value features into multiple heads, which are processed in parallel. Hence, the full mechanism is usually called Multi-head Attention (note that Grouped Query Attention also uses multiple heads). Here, each attention head computes its own attention scores and weighted sums. RoPE then acts on pairs of numbers within each query and key head. To make this concrete, Figure 12 below follows a token representation through the learned query and key projections, which are computed via the weight matrices W Q and W K . In this toy example, each projection produces 16 features, which are reshaped into two heads with eight features each. In the figure below, every small cell contains one scalar feature, meaning one numerical entry in a vector (the numbers are not shown due to space reasons). Figure 15: Projecting a hidden state, reshaping into heads, and pairing features for RoPE. For the first eight-feature head, , we pair each feature in the first half with the corresponding feature in the second half. This gives , , , and . This split-half convention is used in LLM implementations, including my Qwen3 implementation . (We will compare it with the original, alternative adjacent-feature pairing method later after implementing the basic operation.) Each pair gets a rotation angle determined by the token position m and that pair’s frequency θ i . The corresponding query and key pairs use the same frequency. Figure 16 below shows how we rotate the pairs, put the updated features back in their original locations, and compute the query-key dot product. Figure 16: Pairwise rotations produce the rotated query and key vectors used to compute attention scores. The next section will walk through the figure(s) a bit more slowly. For the following example, we’ll use the same two positions as before. The query comes from “the” at position m = 5, and the key comes from the first “fox” at position n = 2. Since, in this example, the key comes before the query, the causal mask allows the query to attend to it. To illustrate the effect that the position has, and keeping everything fixed, let’s assume we start both pairs from the same two values, (1, 5). Figure 17: The first feature pair, (1, 5), takes one entry from each half of the query head. Furthermore, for this example, let’s use θ = 20° per token position ( π /9 radians per position). At position 2, we rotate the key’s arrow counterclockwise by 2 × 20° = 40°. At position 5, we rotate the query’s arrow by 5 × 20° = 100°. Figure 18: Starting from (1, 5), RoPE rotates the key pair at position 2 by 40° and the query pair at position 5 by 100°. To illustrate what’s happening in the figure above, for example, plugging cos 40° ≈ 0.766 and sin 40° ≈ 0.643 into the rotation from Figure 16 gives the new key coordinates: Then, changing 40° to 100°, using the same equation as above, the rotated query pair becomes q′ ≈ (−5.098, 0.117). But the important point is that both arrows still have length √26. Only the rotation changes but the vectors keep the same lengths after the transformation. So, for a query pair ( a , b ) at position m , the two operations here are. For the key pair at position n , we use the same equations with nθ . (Section 4 later shows how RoPE calculates the angular frequency for each feature pair.) To close this section, for those more comfortable reading code, everything about RoPE illustrated so far can be written in code, as follows: The resulting values are: If we rotate all 4 pairs in the 8-feature query (and key) vector(s), we get the vectors below. (We’ll come back to how we go from rotating one pair to rotating all of them later.) Note that, as shown above, the query and key heads have eight features each, which we previously grouped into 4 pairs with two elements each, like (1, 5), and (2, 6), and so on. For simplicity here we’ll follow just the first pair in each head, (1, 5), formed by taking the entries at indices 0 and 4: As shown above, in our example, those entries have values (1, 5) in both heads before the rotation. Also, as in the code above, let’s use the notation q =( q 1 , q 2 ) and k =( k 1 , k 2 ) for these two pairs. To compute their dot product, using the standard dot product formula, we multiply corresponding coordinates and add the products: Before rotation, the pairs have a dot product of 1 × 1 + 5 × 5 = 26. Using the rounded coordinates from the previous Figure 18 gives the contribution from the first pair after rotation: We can see why by writing the dot product in terms of the lengths of the two vectors (arrows in Figure 18) and the angle ϕ between them. In both cases, the vector length is √26. The query (position 5) is rotated by 100° and the key (position 2) is rotated by 40°. The vectors (arrows) start from the same direction, so they end up being 60° apart after rotation. Their exact dot product is 26 × cos(60°) = 13. Now let’s see what happens if we move just the key from position 2 to position 3, but we keep its starting coordinates (1, 5) fixed. The key’s rotation changes now from 2 × 20° = 40° to 3 × 20° = 60°. The query still rotates by 100°, so the angle between the arrows shrinks to 40° and the dot product changes from 13 to 26 × cos(40°) ≈ 19.92. So, moving the key one position closer changed the dot product even though we started with the same feature values. Why do these dot products matter? In attention, we sum the contributions from all feature pairs to get the query-key dot products. RoPE can change those dot products and thus the weights that softmax assigns to the value vectors. In the attention equation above, Q′ and K′ are matrices that contain the rotated queries q′ and keys k′ for one head, V contains the values, and d is the head dimension. Now that we illustrated the computation of the dot products, which is at the core of the attention mechanism, let’s return to positions m = 5 and n = 2. If we shift both positions to the right by three positions, we get m = 8 and n = 5. Each rotation gains 60° (the query goes from 100° to 160°, and the key goes from 40° to 100°), however, the angle between the vectors stays the same. The dot product for this feature pair is still 13. Figure 19: The first pair’s dot product at three different position settings. The key is that the difference between the rotation angles is If we keep the original query and key vectors fixed and shift both token positions by the same amount, RoPE adds the same rotation to both vectors. The angle between them stays the same, so their dot product stays the same. Note that Figure 20 below uses smaller angles than the actual example (20° per position) to keep the picture readable. Figure 20: A shared position shift preserves the relative angle and dot product for fixed query and key features. The examples above and Figure 20 illustrate the main idea behind RoPE. We use each token’s position to rotate the corresponding query and key in the attention module. In the query-key dot product, what matters is how much one vector rotates relative to the other. For each feature pair, this difference in rotation depends only on the offset between the two tokens. To illustrate this in the big picture context, in Figure 21, each row collects the scores for one query. If we consider row 5, the query for “the”, and column 2, the key for “fox”, the attention score between those two is computed as the dot product between the two rotated versions of the query and key vector. Figure 21: The attention scores for one head before softmax. Gray cells mark future keys excluded by the causal mask. What’s the point, again? Let’s once more consider “The red fox jumps over the gray fox.” If we add 100 tokens (e.g., think system prompt) before the sentence, the first “fox” and the second “the” move from positions 2 and 5 to 102 and 105. However, a prefix of any length shifts both positions equally, so they still stay exactly three positions apart. This means, each vector (arrow) gains the exact same additional rotation, which preserves the angle between them and their dot product (assuming we hold the unrotated query and key vectors fixed; in a real model, a new prefix of 100 tokens can change those vectors by changing what the tokens attend to). Figure 22 tracks this comparison in the attention score matrix. The right panel shows the rows and columns for the sentence after we add the prefix. In our toy example, the first pair still contributes 13 to the dot product. Figure 22: The highlighted score moves from row 5, column 2 to row 105, column 102. It keeps the same value if we hold the query and key vectors fixed before rotation. As you may recall, in the original transformer’s sinusoidal encoding, a fixed offset also corresponds to a fixed rotation within each sine/cosine pair. But that shared rotation applies only to the position vectors (added to the input vector) instead of the key and query vectors inside the attention mechanism. Figure 23 compares what this shift changes in the three methods we covered so far. Figure 23: The same position shift under sinusoidal encodings, GPT-2’s learned position embeddings, and RoPE. 3.6 Bonus: Combining the pairs into a complete head in RoPE To see how the relative offset affects the dot product, we focused on one feature pair in the query and key. Now let’s put all four pairs together and see how RoPE rotates the full eight-feature vectors in one attention head. (Please feel free to skip this section if it is too much technical detail.) Figure 24 picks up where Figure 17 left off. We rotate each of the four pairs, then put the results back in the query’s original feature order. Figure 24: RoPE rotates each pair of query features at its own angle. (The same can be applied to the key, which is not shown to keep the illustration simple). Figure 24 above shows the rotated query q′ (at the bottom). Similarly, we could get the rotated key k′ by repeating the same steps at the key’s position. Recall the two equations from Section 3.3. For query pair i with input values ( a i , b i ), let c i = cos( mθ i ) and s i = sin( mθ i ). These are the cosine and sine of the rotation angle for that pair at query position m : Figure 25 below shows the same four rotations between the four pairs as a single matrix multiplication, q′ = R m q . Figure 25: The four rotations from Figure 24 written as one matrix multiplication. The pair labels show where each rotation goes in the full matrix. 4. Computing rotation frequencies in RoPE? A full attention head uses multiple frequencies so that some feature pairs change more drastically (”quickly” in RoPE terms) with position and others change more gradually (”slowly” in RoPE terms). This serves the same purpose as the multiple frequencies in the original transformer’s sinusoidal encodings. However, instead of us assigning these manually, for a head with d features, standard full RoPE computes one frequency for each of its d /2 pairs as follows: d is the head dimension (it has to be even so that all features can be arranged in pairs). i is the index of the pair; it ranges from 0 to d /2−1. b is a chosen base value (hyperparameter) that determines the spacing of the frequencies. θ i is pair i ‘s frequency in radians per token position. The original RoFormer paper uses b = 10,000, borrowing the original transformer’s frequency formula with head dimension d in place of embedding width d model . For example, with head dimension d = 8 and base b = 10,000, we get frequencies [1, 0.1, 0.01, 0.001] radians per position. If you want to see RoPE in a complete model, I recommend checking out my end-to-end Qwen3 from-scratch implementation . Since code can be an effective medium for explaining and understanding concepts, the following subsection will walk you through the core parts that we have covered so far, if you are interested. Otherwise, please feel free to fast forward to section 6, on Positional choices in modern architectures . So, for the following code snippets, we’ll use the same split-half rotation convention as mentioned earlier (the interleaved convention will also be covered, no worries). First, we’ll apply it to one query vector, then we’ll use it on queries and keys inside the attention mechanism. First, let’s reuse the 8-feature query from Figure 24. For convenience, below are its four feature pairs before rotation. Detail from Figure 24. The eight query features form four pairs in the split-half layout. In the earlier non-coding example, we chose a frequency of 20° per token position for the first pair to keep the math simple. Here, we’ll use the original RoPE formula from the previous Section 4 above, θ i = b −2 i / d , with head dimension d = 8 and base b = 10,000. Figure 26 shows how the two functions work together to apply these rotations. Figure 26: rope_params returns the cosine and sine tables for token position 2. rope_split_half takes those tables and the original query and returns the rotated query. As shown in the figure above, first, determines how far to rotate each pair, returning two “tables” that store the cosine and sine of those angles. Or, in other words, computes the cosine and sine of each rotation angle, which depends on the token’s position and the feature pair’s frequency. The array in the function contains the 2 i values from the frequency formula in Section 4: For our eight-feature query, the are , that is, one 2 i value for each feature pair. Suppose we use the common base b = 10,000. And following our earlier examples, we choose a small head dimension of d = 8. In this case, the then computes the four pair frequencies θ i = b −2 i / d as follows: As we can see above, the resulting has one frequency θ i for each of the four feature pairs ( measured in radians) per token position. Next, the then multiplies each pair’s frequency θ i with the token position m , which computes the rotation angle mθ i . In our example, with , we get: Finally, takes the cosine and sine of each angle and outputs them as two so-called cosine and sine tables, and . In both tables, each row is a token position and each column is a feature pair. Since we only use token position 2 here, each table has shape , with the single row shown below: For the example in Figure 26, each table has one row for token position 2 and four columns, one for each feature pair. Figure 27 shows the rotation angle for each pair and the corresponding entries in the two tables. Figure 27: The two tables returned by rope_params for token position 2. The highlighted column gives the cosine and sine used to rotate the first feature pair, (1, 5) . In short, computes the cosine and sine of each rotation angle, which depends on the token’s position and the feature pair’s frequency. In a real-world scenario, if we pass 1,024 token positions for a context size of 1024, and a head dimension of 128, it returns two tensors, and , each with shape since a head with 128 features has 64 pairs. The tables have no batch or head dimension, and we broadcast each table across the batch and head dimensions. So, if we have multi-head attention or grouped query attention with 32 heads, feature pair 0 at token position 2 uses the same rotation angle in all 32 heads. Each head rotates its own feature values, so the rotated queries can still differ across heads. Also, the same entries can be reused across queries, keys, and heads that use the same positions and frequencies. In short, we only need to (pre)compute these tables once per model for all positions up to a maximum supported context size. Technically, it would also be possible to store these tables alongside the model weights; but they are so incredibly cheap to compute that storing them on disk would be overkill. Next, uses those cosines and sines to rotate the actual features in the query and key vectors inside attention. Considering the simple 8-feature example once more, the in the code snippet above splits the query into and and lines up the two entries in each pair. For example, the first slot of each half gives us , the second , and so on. The two expressions inside compute the rotated halves using the equations from Section 3.3: Note that here, everything denoted with a i corresponds to the first half of the query, and everything denoted with b i comes from the second half. The first expression inside computes all the a i ′ values, and the second computes all the b i ′ values. Then, we concatenate the halves, which puts each value back in its original index position via . Here’s the code that produces the rotated query in the earlier Figure 26. The shown reshape just brings the simple toy array into the expected format: one batch item, one head, one token, and eight features. With several positions, each token simply picks up its own row from the and tables. Through broadcasting, PyTorch reuses these same tables across all batch items and attention heads. So far, we coded the RoPE utility functions. Let’s now use it in the real context, the attention mechanism. Here, we use the standard frequency schedule for two 8-feature heads and four token positions. We use random query, key, and value tensors to keep the example self-contained, but as mentioned before, you can optionally also check the end-to-end Qwen3 from-scratch implementation with real query, key, and values produced by the pre-trained model. Note that only and but not pass through RoPE. The resulting raw attention scores are stored in a tensor of shape , that is, one row for each query position, and a column for each key position, and 4x4 since we have four tokens where each attends to each other. Then, using a conventional attention code implementation, the causal mask replaces the scores for future keys with negative infinity, so they get zeroed after the softmax. The resulting tensor has shape ; the 4 because we have four tokens, and the 8 because the embedding dimension was originally 8. We can also check that our claim about relative offsets holds, meaning that adding 3 to each position should change the position but preserve the query-key offsets: I mentioned the split-halves convention many times throughout this article. The original RoPE paper uses the alternative interleaved convention, as does the original LLaMA implementation (but as mentioned before, most code implementations now use the split-halves, because it makes it easier, in code, to rotate all pairs at once with element-wise sine and cosine operations.) To illustrate the difference between the two layouts, Figure 28 below uses the same 8-feature vector in both rows. Figure 28: Split-half pairs each feature in the first half with the corresponding feature in the second half. Interleaved pairs adjacent features. The interleaved implementation uses the same two equations, but selects alternating features and interleaves the outputs. But mathematically, the layouts are equivalent when we account for the feature order. So, rearranging the entries to makes the split-half pairs adjacent with pairs (1, 5), (2, 6), and so on. If we apply the same rearrangement to both queries and keys, it results in identical dot products. The outputs retain the reordered features, so we compare them with the split-half outputs in that same order. Applying the two layouts to the original vector however would give different scores. RoPE has been a staple in most (open-weight) LLMs since the original LLaMA model . Of course, proprietary models may use it as well, but it’s always hard to say anything with 100% certainty about proprietary models. However, in recent years, many architectures have been moving away from full-blown RoPE in every transformer block. In the following subsection, we will discuss some of these variants. For instance the full RoPE implementation we discussed and implemented in the sections above rotates every feature pair in every query and key head. In the following examples in the subsections above below, we will see that models only rotate some features within a head, other models skip RoPE in some transformer blocks, and some models use a different approach and add position information directly to their attention scores. As discussed throughout the article, regular “full” RoPE rotates all dimensions in each query and key head. Partial RoPE is a variant that rotates only a subset, while leaving the remaining dimensions unchanged. For example, MiniMax-M3’s configuration uses 64 rotary dimensions within each 128-dimensional head. That gives 32 rotated feature pairs and 64 unchanged dimensions. The figure below illustrates how that looks like. Figure 29: Full RoPE and partial RoPE in a 128-dimensional head. Note that if we look past the first transformer block, the unrotated features can still contain position information inherited from earlier transformer blocks. Anyways, what’s the point behind partial RoPE? It saves some memory. For example, in the MiniMax-M3 example above, rotating half the features reduces the size of the precomputed cosine and sine tables also in half. So, with partial RoPE, instead of 64 columns, now each table only needs 32 columns. However, note that the KV cache still stores the full key and value vectors for each cached token. For MiniMax-M3’s 1M-token context, rotating 64 of the 128 features halves the size of the precomputed cosine and sine tables, saving 0.134 GB (128 MiB) if the tables are stored in BF16. If the tables themselves were stored in NVFP4, the savings would be 0.038 GB (36 MiB), including the block scales. Note that in experiments with 1B to 8B models, the Fractional Rotation, Full Potential? paper found that rotating around 10% of each head’s features often gave similar training loss and benchmark accuracy to full RoPE. However, full RoPE did better on some evaluations. So, in my opinion, partial RoPE is hardly worth it. NoPE was coined in the The Impact of Positional Encoding on Length Generalization in Transformers paper and means no explicit positional encoding . The idea or observation is that an attention layer without any explicit position method still has a causal mask, where a query can attend only to itself and earlier tokens. And this causal masking implicitly provides positional information. Let’s use the first four tokens from our earlier example, . In Figure 30, the query for at position 2 can attend to , , and itself. The query for at position 1 can attend to and itself. Figure 30: Example of a causal mask in the attention mechanism. So, the next question is how can the model use the causal mask as a position signal? Here’s a toy example adapted from the paper. Suppose one feature of the value vectors is 1 for and 0 for the other three tokens. Since the input only contains only one , every visible prefix contains exactly one 1. If all non-masked keys get the same attention score, the softmax assigns every visible token equal weight. So at , attention averages 1, 0, and 0, which gives 1/3. At , it averages four values and gets 1/4. In other words, this output feature equals one over the prefix length, which a later layer can use as a signal for position. Figure 31: With uniform attention, the contribution from The shrinks as the prefix grows. The query for fox assigns The a weight of 1/3. Does NoPE work in practice? The researchers of the NoPE paper trained a tiny 107M-parameter decoder-only transformers from scratch on tasks such as copying, sorting, and addition to do some ablation. When they tested the small model on examples longer than those seen during training, interestingly, NoPE ranked first overall across the ten tasks and ahead of RoPE. The researchers behind the NoPE paper also conducted a separate experiment with a larger 1.3B-parameter models trained on code. Here, NoPE also handled contexts beyond the training length, however, its next-token predictions got worse at the longest lengths tested. Some of today’s open-weight LLMs even go so far and use NoPE in all layers. However, nowadays, it’s more common for models to omit RoPE in at least some layers, where layer here means transformer block. To give a concrete example, SmolLM3 (3B parameters) applies RoPE in three layers and skips it in the fourth, repeating that pattern through 36 layers. Interestingly, the SmolLM3 authors mentioned that this layer pattern improved long-context performance. (Also note that any later layer, following the first one, even though it may skip the rotation, still receives the inputs from preceding transformer blocks, so its queries and keys still receive some sort of position information from earlier layers.) Figure 32: SmolLM3’s architecture (left) and the positional method used in each of its 36 transformer blocks (right). Every fourth block skips RoPE. Architecture diagram from my LLM Architecture Gallery . 6.3 Learned relative position bias Before we get to the overview and look at what modern architectures use, there’s one more method to introduce. For instance, Thinky’s Inkling uses a learned relative position bias in both its sliding-window and global attention layers. It computes the usual scaled dot product between a query and key, and then it adds a certain number to that score before the softmax in the attention score computation. That number depends on the query token’s hidden state and how many positions back the key is. Let’s reuse our example sentence, “The red fox jumps over the gray fox.” (It’s the last time, I promise!) In the figure below, the “the” at position 5 is the query and “fox” at position 2 is the key. Inkling then uses the three-position gap between query and key and the hidden state for “the” to compute the bias, then adds it to the scaled dot product. Figure 33: Inkling adds a learned relative position bias to the scaled query-key dot product before softmax. The numbers are illustrative. This is not an entirely new idea. Some of you may recall Google’s popular T5 (Text-to-Text Transfer Transformer) in 2019, which used a simpler version of this idea. Figure 34: The original Inkling (975B) architecture. The learned relative position bias feeds into the attention module. LLM Architecture Gallery 6.4 How these choices appear in recent models Now, after all this build up, the interesting question is: which architecture uses which method? And what are the recent trends? To answer this, I grouped the entries in my LLM Architecture Gallery by their listed release dates and compared the 2025 releases with the earlier and later releases in the 2026 snapshot. Each gallery card counts once, so multiple variants of an architecture can contribute to the results. LLM Architecture Gallery Figure 35: The architecture diagrams illustrate which attention layers use RoPE, and the bars show the share of gallery entries in each category. Diagrams from my LLM Architecture Gallery . As we can see in Figure 35 above, using RoPE in every softmax attention layer is still the most common choice. However, its use fell from 2025 to 2026, and then also in the latter half of 2026, which could be a trend. Consequently, there is a growing number of models that mix RoPE and NoPE. The groups are still small, so it’s hard to say whether these trends will continue. The NoPE only entries were all recurrent hybrids with softmax attention layers that use no explicit positional encoding. The “Other” category here refers to xLSTM 7B (2025) and Inkling (2026). xLSTM has no softmax attention layers. Inkling adds a learned bias to the attention scores before softmax, as we saw in Section 6.3. Among the models that use RoPE, partial RoPE became more common from 2025 to 2026. It went from a minority of the RoPE models in 2025 to a majority in both 2026 groups, as shown in Figure 36. Figure 36: Among gallery entries that use RoPE, partial RoPE rotates a subset of query and key features in at least one attention layer. Full-width entries rotate all query and key features in every layer that uses RoPE. If you’d like to look up an individual model from the 2026 groups, Figure 37 below shows the 2026 gallery overview with the individual architectures labeled by position type. You can also browse the gallery interactively here . Figure 37: The individual 2026 gallery entries behind the two 2026 bars in Figure 35. 7. Final thoughts So, to recap, we discussed GPT-2 and the original transformer that add a position vector to each token embedding before the first transformer block. Then, modern LLMs switched to RoPE, which encodes relative position inside attention by rotating queries and keys. Surprisingly, RoPE remains as the most popular positional embedding method today. Recently, however, Inkling picked up an idea from T5 to add a learned relative position bias to the attention scores before softmax. And then we also have NoPE-RoPE architectures, which omit RoPE in some layers. It may be boring news, but as mentioned before, RoPE is still the predominant position embedding method, and I think this will carry over into 2027 for sure. Perhaps, though, we’ll see more architectures with an Inkling-like design coming up in 2027. While this may sound “boring”, I am glad that I finally got this article on RoPE (and other position info methods) out, after so many years, so that I can add it to my collection of LLM “fundamentals” explainers. If you are interested in the other architecture building blocks of LLMs, I still highly recommend starting with a GPT-2-style model, which will give you a solid understanding of the building blocks with the least amount of friction. And from there, you can then layer on additional methods (such as RoPE). If you’d like to build that GPT-2-style model yourself, my first Build a Large Language Model (From Scratch) book walks through all the building blocks depicted in the figure below. Figure 38: GPT-2 XL provides a baseline for seeing what newer architectures change. LLM Architecture Gallery For the methods that branch off from the GPT-2 baseline, I’ve collected some of my relevant blog articles below, starting with a refresher on self-attention: Self-attention, causal masking, and multi-head attention: Understanding and Coding Self-Attention, Multi-Head Attention, Causal-Attention, and Cross-Attention in LLMs Modern attention variants (GQA, MLA, sliding-window attention, sparse attention, and hybrids): A Visual Guide to Attention Variants in Modern LLMs The KV cache. Understanding and Coding the KV Cache in LLMs from Scratch SwiGLU feed-forward layers and normalization (LayerNorm and RMSNorm): From GPT-2 to gpt-oss: Analyzing the Architectural Advances Mixture-of-experts layers and expert routing. The Big LLM Architecture Comparison Residual connections and DeepSeek’s manifold-constrained hyper-connections (mHC): Recent Developments in LLM Architectures: KV Sharing, mHC, and Compressed Attention Putting some of the pieces together in Qwen3: Understanding and Implementing Qwen3 From Scratch walks through implementing the dense and mixture-of-experts versions in PyTorch. Thanks for reading and supporting my work! PS: I started experimenting with Substack’s new “perks” system. As a thank-you to supporters, I’ve added image exports and metadata from the architecture gallery for you to use in your own analyses. Figure 1: A preview of the gallery’s 2026 architectures, grouped by positional encoding. Architecture figures taken from my LLM gallery . But why spending so much time writing/reading about this rather minor building block? LLMs keep evolving, and as I was preparing a new article on the latest LLM architecture trends this year, I realized that I never covered the positional information methods used in LLMs in any article so far. So, instead of letting the other article get out of hand, I thought it might make sense to publish this as a standalone building block for the upcoming LLM architecture and trends analysis. Also, over the years, many readers have asked me for a tutorial on relative positional embeddings (aka RoPE) to follow up on the learned absolute embeddings used in GPT. It’s been on my TODO list for a long time, so I finally revisited my old draft and put this walkthrough together, which will cover different positional methods in LLMs; (finally) how RoPE works; what methods are used by recent open LLMs. Figure 2: Token embedding layers in GPT-2 and MiniMax-M3, highlighted in orange. (Side note: M3’s first three out of 60 feedforward layers are dense not MoEs.) A token embedding layer, shown in the figure above, maps each token ID to a vector. Position information is then added afterward. Concretely, and as we will discuss in more detail later, GPT-2 adds a position vector to each token embedding before the modified embedding enters the first transformer block. On the other hand, MiniMax-M3 adds the positional information in each transformer block using a method called RoPE inside attention. We will talk about these methods in more detail later, but first, let’s start with the big picture information explaining why explicit positional information is added or needed. 1.1 Why add positional information? Consider the following two input sentences as a simple example: “The red fox jumps over the gray fox.” “The gray fox jumps over the red fox.” Figure 3: Changing the word order changes which fox jumps. For the examples in this article, we will treat each word as one token for simplicity. (As you know, real tokenizers can split words into smaller subword tokens.) The first sentence then has eight token positions, from 0 through 7. Figure 4: Token IDs and positions in the toy sentence. (If you are interested in how vocabularies are built, check out my tokenizer materials on GitHub .) Note that “fox”, which appears twice in the input sentence, gets the same token ID 2 in both cases. And since they both have the same token ID, irrespective of the position in the input sentence, they would get the same embedding vector from the embedding layer. Now, let’s consider a regular self-attention mechanism with no positional encoding (and no causal mask), where every input token can attend to every other token in the input. In this scenario, swapping any two words, like “red” and “gray”, would still result in the same embeddings and attention scores between each token pair. GPT-style models do use a causal (autoregressive) mask, which restricts each token to itself and earlier tokens. Interestingly, this causal mask gives the computation some implicit order information. In our example, “jumps” can attend to “red” in the first sentence and “gray” in the second. So, a causal LLM can theoretically already distinguish these sentences even without explicit positional embeddings. (We will return to this idea later when discussing the “NoPE” concept.) Nonetheless, GPT-2 and most newer LLMs include explicit positional information because it gives attention a direct signal about positions. That’s because even though the causal mask determines which tokens are accessible and provides implicit order information, it doesn’t distinguish a separation of one position from a separation of ten, for example. So, explicit positional methods are still useful (or even essential), since they supply that information. If this all sounded confusing, don’t worry, it was more meant as an overview, and we will step through these concepts a bit more slowly in the remaining article. 2. Adding a position vector to each token embedding We briefly talked about implicit positional information through causal attention masks (and we will revisit this again in more detail later). However, we now switch gears and talk about the explicit ways to add positional information. The perhaps simplest and most direct (but not “cheapest”) approach is to give each sequence position its own vector. We add that vector to the token embedding, so the resulting, modified embedding vector is then passed to the first transformer block. This exact procedure is discussed in the following subsections. 2.1 Learned absolute position embeddings in GPT-2 To illustrate the use of an explicit, learned positional vector to the input embeddings, let’s consider GPT-2 as a concrete example. GPT-2 learns a table of position vectors during training. The following figure illustrates where these vectors are used in the architecture, that is, immediately after the token embedding lookup and before the first transformer block. Figure 5: GPT-2 adds absolute position information before the transformer blocks, as highlighted in purple. The dimensions shown are for GPT-2 XL . The positional embedding layer depicted in the figure above follows the same implementation as the token embedding layer, i.e., they have exactly the same output dimensions so that the resulting input vectors can be added to each other. The code below shows that with an excerpt of a GPT-2 code implementation: And in mathematical terms, we can write it as follows. Let m be a position index and x m the token ID at that position. The input to the first block is Here, E token is the embedding layer, P m is the position info vector selected by m , and h m is the resulting summed embedding and position vector. Figure 6: Token and position embeddings are added element-wise. (I am following the convention here that neural network diagrams are usually read from bottom to top.) In the figure above, at position 0, adding the token embedding to the position embedding gives . By the way, the values in the figure are chosen to keep the illustration simple; in a real example, both embedding layers (tables) are initialized with small random values and learned during training. So, what we covered in this section is a so-called absolute positional method because the positional embedding P m depends on the token’s own position m . In the previous example sentence, the two “fox” tokens have initially the same token embeddings, but because we are adding different positional vectors P 2 and P 7 , they have different values before they enter the first transformer block. And consequently, the query, key, and value vectors inside the attention mechanisms then also receive representations that already include position information. Note that the original GPT-2 implementation has 1,024 learned position vectors. This means it only works with inputs with 1024 or fewer tokens. If we want to extend the context window, we would have to extend this embedding table. And since the embedding table (layer) is updated like any other layer during training, the context length would have to be decided before the training starts. Extending the context would be very expensive since the table can become very large. For example, in the case of GPT-2 Medium, the positional embedding layer weights only make up 0.30% of the total weights at 1,024 positions. However, if we increased the context length to a nowadays common 100k range, they would make up >22% of the total model weights, which would be very uneconomic. 2.2 Fixed sinusoidal position encodings in the original transformer The original “Attention Is All You Need” transformer from 2017, which predates GPT, uses the same addition mechanism, but computes its position vectors with fixed sine and cosine functions. Figure 7 below shows this addition before both the encoder and decoder stacks. The encoder processes the input sequence, and the decoder generates the output sequence. (The reason why it’s introduced here is that the sine and cosine functions will become relevant again later when discussing RoPE.) Figure 7: Sinusoidal position encodings added to the token embeddings as highlighted in purple. The original transformer also scales its token embeddings by √( d model ) before adding the position vectors, where d model is the embedding width. So, while GPT-2 in the previous section had the formula the formula used in the original transformer (depicted in Figure 7) is: This scaling by √( d model ) is a minor technical detail, but for those who are curious, the motivation behind this scaling factor is not explained in the transformer paper, but as I discussed with colleagues on a Twitter thread many years ago, it’s likely to put the token embeddings and sinusoidal positional encodings on comparable numerical magnitudes at initialization, so the position vectors don’t dominate the sum when we add them. In the GPT-2 case, this scaling wasn’t necessary because the original GPT-2 code initialized the token embeddings to have an initial standard deviation of 0.02 and the position embeddings to have an initial standard deviation of 0.01 so that they were already roughly on the same scale. Now, the more interesting point is how the position embeddings P m are computed. Concretely, each position vector has the following entries: As before, m denotes the position. The index i indexes a pair of features within the vector. Here, a feature is one number in the position vector. For example, let’s assume we have a small vector with 8 values ( d model = 8) that has entries numbered 0 through 7. (In the original paper this was 512 for the small model and 1024 for the bigger model, instead of 8, but that would be hard to visualize.) We group these into four pairs so that i goes from 0 through 3. Figure 8: Sine and cosine entries for each feature pair. Here, the indices 2 i and 2 i + 1 select the two entries corresponding to pair i . As shown in the equation earlier, the angle at position m , which is then fed into the sine or cosine functions to obtain P m , 2 i or P m , 2 i + 1 , respectively, is computed as follows: Figure 9: The angle inside sine and cosine is the token position multiplied by the pair’s angular frequency. Figure 10 shows this calculation for all four pairs of our 8-feature example at position m = 2. Figure 10: The four sine and cosine pairs at position 2. For an eight-feature embedding, the four frequencies are 1, 0.1, 0.01, and 0.001 radians per position. At position 2, the first pair in row 1 is (sin 2, cos 2) ≈ (0.909, −0.416). The second pair, in row 2, changes more slowly, giving (sin 0.2, cos 0.2) ≈ (0.199, 0.980). The figure below visualizes the sine and cosine calculations for different pairs, which are then collected in a position vector. Figure 11: Sampling sine and cosine functions to form a position vector. In short, this method is a (more complicated) alternative to obtaining positional embedding vectors compared to the GPT-2 method discussed earlier. Similar to the GPT-2 embeddings, these are also absolute embeddings because each vector is computed from its own position. However, in contrast to the GPT-2 approach, the sine and cosine functions stay fixed during training. (Also, they can be extended and evaluated beyond the training positions, like beyond the context length of 1024, although that alone doesn’t guarantee that the model will perform well there, because it hasn’t seen those during training.) To summarize, Figure 12 below compares the two ways of obtaining a position vector we discussed so far. Figure 12: Fixed sinusoidal and learned absolute positional embeddings. This sinusoidal method may look like an overly complicated way to obtain positional embeddings, however, understanding it will be useful when talking about RoPE in the next section. Also, there is some rationale behind it. The authors chose sine and cosine because they make the shifting by a certain offset gives a certain deterministic difference. For example, the difference between position 2 to 5 and the difference between 102 to 105 is both 3, which then results in the same rotation. According to the Attention Is All You Need paper: “...easily learn to attend by relative positions, since for any fixed offset k , PE pos + k can be represented as a linear function of PE pos .” Or in less technical terms, the authors hypothesized that this property would make it easier for attention to learn relationships such as “three tokens earlier.” Figure 13 below illustrates this for one sine/cosine pair. A rotation is a linear transformation, and both three-position shifts use the same rotation. Figure 13: For a pair with angular frequency 0.1 radians per position, a shift of three positions always rotates the pair by 0.3 radians. 3. Encoding relative position with RoPE So, the sinusoidal method above is still considered an absolute positional encoding because the vector added to each token embedding represents that token’s position counted from the start of the sequence. As shown in the previous figure, for example, tokens at positions 2 and 5 receive the position vectors P 2 and P 5 . If we move those tokens to positions 102 and 105, they’re still three positions apart. But each token gets a different position vector because its absolute position m has changed. So their attention score can change even when the token embeddings stay the same. The sinusoidal structure still gives the model a way to learn relative relationships. Anyways, RoPE, which we will discuss below, builds this relative relationship directly into the attention calculation. RoPE, which Su et al. introduced in the 2021 RoFormer paper , stands for Rotary Position Embedding and is considered a relative position method. 3.1 Moving the rotation inside attention in RoPE In attention, each token’s current representation is projected into a query, a key, and a value vector. Query-key dot products determine attention scores. After masking and softmax, the resulting weights determine how the value vectors are mixed. For a refresher, see my Understanding and Coding Self-Attention, Multi-Head Attention, Causal-Attention, and Cross-Attention in LLMs article: RoPE uses the token’s position to rotate its query and key vectors before their dot product. The value vectors bypass this rotation. Figure 14 below shows an overview of where RoPE is applied in a relatively recent MiniMax-M3, where QK-Norm normalizes queries and keys before RoPE. Figure 14: MiniMax-M3 applies RoPE to queries and keys inside attention. As shown in the figure above, the LLM architecture has no explicit position vector added alongside the initial token embedding. Its explicit position signal is injected inside attention instead. Side note: MiniMax-M3 rotates only part of each query and key head, a variation known as “partial RoPE” that we will cover later in Section 6.1. But to understand the basic RoPE operation first, let’s walk through the method step by step using a small example. 3.2 From token representations to feature pairs in RoPE Attention usually divides its query, key, and value features into multiple heads, which are processed in parallel. Hence, the full mechanism is usually called Multi-head Attention (note that Grouped Query Attention also uses multiple heads). Here, each attention head computes its own attention scores and weighted sums. RoPE then acts on pairs of numbers within each query and key head. To make this concrete, Figure 12 below follows a token representation through the learned query and key projections, which are computed via the weight matrices W Q and W K . In this toy example, each projection produces 16 features, which are reshaped into two heads with eight features each. In the figure below, every small cell contains one scalar feature, meaning one numerical entry in a vector (the numbers are not shown due to space reasons). Figure 15: Projecting a hidden state, reshaping into heads, and pairing features for RoPE. For the first eight-feature head, , we pair each feature in the first half with the corresponding feature in the second half. This gives , , , and . This split-half convention is used in LLM implementations, including my Qwen3 implementation . (We will compare it with the original, alternative adjacent-feature pairing method later after implementing the basic operation.) Each pair gets a rotation angle determined by the token position m and that pair’s frequency θ i . The corresponding query and key pairs use the same frequency. Figure 16 below shows how we rotate the pairs, put the updated features back in their original locations, and compute the query-key dot product. Figure 16: Pairwise rotations produce the rotated query and key vectors used to compute attention scores. The next section will walk through the figure(s) a bit more slowly. 3.3 Rotating one pair in RoPE For the following example, we’ll use the same two positions as before. The query comes from “the” at position m = 5, and the key comes from the first “fox” at position n = 2. Since, in this example, the key comes before the query, the causal mask allows the query to attend to it. To illustrate the effect that the position has, and keeping everything fixed, let’s assume we start both pairs from the same two values, (1, 5). Figure 17: The first feature pair, (1, 5), takes one entry from each half of the query head. Furthermore, for this example, let’s use θ = 20° per token position ( π /9 radians per position). At position 2, we rotate the key’s arrow counterclockwise by 2 × 20° = 40°. At position 5, we rotate the query’s arrow by 5 × 20° = 100°. Figure 18: Starting from (1, 5), RoPE rotates the key pair at position 2 by 40° and the query pair at position 5 by 100°. To illustrate what’s happening in the figure above, for example, plugging cos 40° ≈ 0.766 and sin 40° ≈ 0.643 into the rotation from Figure 16 gives the new key coordinates: Then, changing 40° to 100°, using the same equation as above, the rotated query pair becomes q′ ≈ (−5.098, 0.117). But the important point is that both arrows still have length √26. Only the rotation changes but the vectors keep the same lengths after the transformation. So, for a query pair ( a , b ) at position m , the two operations here are. For the key pair at position n , we use the same equations with nθ . (Section 4 later shows how RoPE calculates the angular frequency for each feature pair.) To close this section, for those more comfortable reading code, everything about RoPE illustrated so far can be written in code, as follows: The resulting values are: If we rotate all 4 pairs in the 8-feature query (and key) vector(s), we get the vectors below. (We’ll come back to how we go from rotating one pair to rotating all of them later.) 3.4 How the relative offset changes the attention score in RoPE Note that, as shown above, the query and key heads have eight features each, which we previously grouped into 4 pairs with two elements each, like (1, 5), and (2, 6), and so on. For simplicity here we’ll follow just the first pair in each head, (1, 5), formed by taking the entries at indices 0 and 4: As shown above, in our example, those entries have values (1, 5) in both heads before the rotation. Also, as in the code above, let’s use the notation q =( q 1 , q 2 ) and k =( k 1 , k 2 ) for these two pairs. To compute their dot product, using the standard dot product formula, we multiply corresponding coordinates and add the products: Before rotation, the pairs have a dot product of 1 × 1 + 5 × 5 = 26. Using the rounded coordinates from the previous Figure 18 gives the contribution from the first pair after rotation: We can see why by writing the dot product in terms of the lengths of the two vectors (arrows in Figure 18) and the angle ϕ between them. In both cases, the vector length is √26. The query (position 5) is rotated by 100° and the key (position 2) is rotated by 40°. The vectors (arrows) start from the same direction, so they end up being 60° apart after rotation. Their exact dot product is 26 × cos(60°) = 13. Now let’s see what happens if we move just the key from position 2 to position 3, but we keep its starting coordinates (1, 5) fixed. The key’s rotation changes now from 2 × 20° = 40° to 3 × 20° = 60°. The query still rotates by 100°, so the angle between the arrows shrinks to 40° and the dot product changes from 13 to 26 × cos(40°) ≈ 19.92. So, moving the key one position closer changed the dot product even though we started with the same feature values. Why do these dot products matter? In attention, we sum the contributions from all feature pairs to get the query-key dot products. RoPE can change those dot products and thus the weights that softmax assigns to the value vectors. In the attention equation above, Q′ and K′ are matrices that contain the rotated queries q′ and keys k′ for one head, V contains the values, and d is the head dimension. 3.5 Why shifting both positions preserves the attention score in RoPE Now that we illustrated the computation of the dot products, which is at the core of the attention mechanism, let’s return to positions m = 5 and n = 2. If we shift both positions to the right by three positions, we get m = 8 and n = 5. Each rotation gains 60° (the query goes from 100° to 160°, and the key goes from 40° to 100°), however, the angle between the vectors stays the same. The dot product for this feature pair is still 13. Figure 19: The first pair’s dot product at three different position settings. The key is that the difference between the rotation angles is If we keep the original query and key vectors fixed and shift both token positions by the same amount, RoPE adds the same rotation to both vectors. The angle between them stays the same, so their dot product stays the same. Note that Figure 20 below uses smaller angles than the actual example (20° per position) to keep the picture readable. Figure 20: A shared position shift preserves the relative angle and dot product for fixed query and key features. The examples above and Figure 20 illustrate the main idea behind RoPE. We use each token’s position to rotate the corresponding query and key in the attention module. In the query-key dot product, what matters is how much one vector rotates relative to the other. For each feature pair, this difference in rotation depends only on the offset between the two tokens. To illustrate this in the big picture context, in Figure 21, each row collects the scores for one query. If we consider row 5, the query for “the”, and column 2, the key for “fox”, the attention score between those two is computed as the dot product between the two rotated versions of the query and key vector. Figure 21: The attention scores for one head before softmax. Gray cells mark future keys excluded by the causal mask. What’s the point, again? Let’s once more consider “The red fox jumps over the gray fox.” If we add 100 tokens (e.g., think system prompt) before the sentence, the first “fox” and the second “the” move from positions 2 and 5 to 102 and 105. However, a prefix of any length shifts both positions equally, so they still stay exactly three positions apart. This means, each vector (arrow) gains the exact same additional rotation, which preserves the angle between them and their dot product (assuming we hold the unrotated query and key vectors fixed; in a real model, a new prefix of 100 tokens can change those vectors by changing what the tokens attend to). Figure 22 tracks this comparison in the attention score matrix. The right panel shows the rows and columns for the sentence after we add the prefix. In our toy example, the first pair still contributes 13 to the dot product. Figure 22: The highlighted score moves from row 5, column 2 to row 105, column 102. It keeps the same value if we hold the query and key vectors fixed before rotation. As you may recall, in the original transformer’s sinusoidal encoding, a fixed offset also corresponds to a fixed rotation within each sine/cosine pair. But that shared rotation applies only to the position vectors (added to the input vector) instead of the key and query vectors inside the attention mechanism. Figure 23 compares what this shift changes in the three methods we covered so far. Figure 23: The same position shift under sinusoidal encodings, GPT-2’s learned position embeddings, and RoPE. 3.6 Bonus: Combining the pairs into a complete head in RoPE To see how the relative offset affects the dot product, we focused on one feature pair in the query and key. Now let’s put all four pairs together and see how RoPE rotates the full eight-feature vectors in one attention head. (Please feel free to skip this section if it is too much technical detail.) Figure 24 picks up where Figure 17 left off. We rotate each of the four pairs, then put the results back in the query’s original feature order. Figure 24: RoPE rotates each pair of query features at its own angle. (The same can be applied to the key, which is not shown to keep the illustration simple). Figure 24 above shows the rotated query q′ (at the bottom). Similarly, we could get the rotated key k′ by repeating the same steps at the key’s position. Recall the two equations from Section 3.3. For query pair i with input values ( a i , b i ), let c i = cos( mθ i ) and s i = sin( mθ i ). These are the cosine and sine of the rotation angle for that pair at query position m : Figure 25 below shows the same four rotations between the four pairs as a single matrix multiplication, q′ = R m q . Figure 25: The four rotations from Figure 24 written as one matrix multiplication. The pair labels show where each rotation goes in the full matrix. 4. Computing rotation frequencies in RoPE? A full attention head uses multiple frequencies so that some feature pairs change more drastically (”quickly” in RoPE terms) with position and others change more gradually (”slowly” in RoPE terms). This serves the same purpose as the multiple frequencies in the original transformer’s sinusoidal encodings. However, instead of us assigning these manually, for a head with d features, standard full RoPE computes one frequency for each of its d /2 pairs as follows: Here, d is the head dimension (it has to be even so that all features can be arranged in pairs). i is the index of the pair; it ranges from 0 to d /2−1. b is a chosen base value (hyperparameter) that determines the spacing of the frequencies. θ i is pair i ‘s frequency in radians per token position. Figure 26: rope_params returns the cosine and sine tables for token position 2. rope_split_half takes those tables and the original query and returns the rotated query. As shown in the figure above, first, determines how far to rotate each pair, returning two “tables” that store the cosine and sine of those angles. Or, in other words, computes the cosine and sine of each rotation angle, which depends on the token’s position and the feature pair’s frequency. The array in the function contains the 2 i values from the frequency formula in Section 4: For our eight-feature query, the are , that is, one 2 i value for each feature pair. Suppose we use the common base b = 10,000. And following our earlier examples, we choose a small head dimension of d = 8. In this case, the then computes the four pair frequencies θ i = b −2 i / d as follows: As we can see above, the resulting has one frequency θ i for each of the four feature pairs ( measured in radians) per token position. Next, the then multiplies each pair’s frequency θ i with the token position m , which computes the rotation angle mθ i . In our example, with , we get: Finally, takes the cosine and sine of each angle and outputs them as two so-called cosine and sine tables, and . In both tables, each row is a token position and each column is a feature pair. Since we only use token position 2 here, each table has shape , with the single row shown below: For the example in Figure 26, each table has one row for token position 2 and four columns, one for each feature pair. Figure 27 shows the rotation angle for each pair and the corresponding entries in the two tables. Figure 27: The two tables returned by rope_params for token position 2. The highlighted column gives the cosine and sine used to rotate the first feature pair, (1, 5) . In short, computes the cosine and sine of each rotation angle, which depends on the token’s position and the feature pair’s frequency. In a real-world scenario, if we pass 1,024 token positions for a context size of 1024, and a head dimension of 128, it returns two tensors, and , each with shape since a head with 128 features has 64 pairs. The tables have no batch or head dimension, and we broadcast each table across the batch and head dimensions. So, if we have multi-head attention or grouped query attention with 32 heads, feature pair 0 at token position 2 uses the same rotation angle in all 32 heads. Each head rotates its own feature values, so the rotated queries can still differ across heads. Also, the same entries can be reused across queries, keys, and heads that use the same positions and frequencies. In short, we only need to (pre)compute these tables once per model for all positions up to a maximum supported context size. Technically, it would also be possible to store these tables alongside the model weights; but they are so incredibly cheap to compute that storing them on disk would be overkill. Next, uses those cosines and sines to rotate the actual features in the query and key vectors inside attention. Considering the simple 8-feature example once more, the in the code snippet above splits the query into and and lines up the two entries in each pair. For example, the first slot of each half gives us , the second , and so on. The two expressions inside compute the rotated halves using the equations from Section 3.3: Note that here, everything denoted with a i corresponds to the first half of the query, and everything denoted with b i comes from the second half. The first expression inside computes all the a i ′ values, and the second computes all the b i ′ values. Then, we concatenate the halves, which puts each value back in its original index position via . Here’s the code that produces the rotated query in the earlier Figure 26. The shown reshape just brings the simple toy array into the expected format: one batch item, one head, one token, and eight features. With several positions, each token simply picks up its own row from the and tables. Through broadcasting, PyTorch reuses these same tables across all batch items and attention heads. 5.2 Using RoPE inside causal attention So far, we coded the RoPE utility functions. Let’s now use it in the real context, the attention mechanism. Here, we use the standard frequency schedule for two 8-feature heads and four token positions. We use random query, key, and value tensors to keep the example self-contained, but as mentioned before, you can optionally also check the end-to-end Qwen3 from-scratch implementation with real query, key, and values produced by the pre-trained model. Note that only and but not pass through RoPE. The resulting raw attention scores are stored in a tensor of shape , that is, one row for each query position, and a column for each key position, and 4x4 since we have four tokens where each attends to each other. Then, using a conventional attention code implementation, the causal mask replaces the scores for future keys with negative infinity, so they get zeroed after the softmax. The resulting tensor has shape ; the 4 because we have four tokens, and the 8 because the embedding dimension was originally 8. We can also check that our claim about relative offsets holds, meaning that adding 3 to each position should change the position but preserve the query-key offsets: 5.3 An alternative feature-pairing convention I mentioned the split-halves convention many times throughout this article. The original RoPE paper uses the alternative interleaved convention, as does the original LLaMA implementation (but as mentioned before, most code implementations now use the split-halves, because it makes it easier, in code, to rotate all pairs at once with element-wise sine and cosine operations.) To illustrate the difference between the two layouts, Figure 28 below uses the same 8-feature vector in both rows. Figure 28: Split-half pairs each feature in the first half with the corresponding feature in the second half. Interleaved pairs adjacent features. The interleaved implementation uses the same two equations, but selects alternating features and interleaves the outputs. But mathematically, the layouts are equivalent when we account for the feature order. So, rearranging the entries to makes the split-half pairs adjacent with pairs (1, 5), (2, 6), and so on. If we apply the same rearrangement to both queries and keys, it results in identical dot products. The outputs retain the reordered features, so we compare them with the split-half outputs in that same order. Applying the two layouts to the original vector however would give different scores. 6. Positional choices in modern architectures RoPE has been a staple in most (open-weight) LLMs since the original LLaMA model . Of course, proprietary models may use it as well, but it’s always hard to say anything with 100% certainty about proprietary models. However, in recent years, many architectures have been moving away from full-blown RoPE in every transformer block. In the following subsection, we will discuss some of these variants. For instance the full RoPE implementation we discussed and implemented in the sections above rotates every feature pair in every query and key head. In the following examples in the subsections above below, we will see that models only rotate some features within a head, other models skip RoPE in some transformer blocks, and some models use a different approach and add position information directly to their attention scores. 6.1 Partial RoPE As discussed throughout the article, regular “full” RoPE rotates all dimensions in each query and key head. Partial RoPE is a variant that rotates only a subset, while leaving the remaining dimensions unchanged. For example, MiniMax-M3’s configuration uses 64 rotary dimensions within each 128-dimensional head. That gives 32 rotated feature pairs and 64 unchanged dimensions. The figure below illustrates how that looks like. Figure 29: Full RoPE and partial RoPE in a 128-dimensional head. Note that if we look past the first transformer block, the unrotated features can still contain position information inherited from earlier transformer blocks. Anyways, what’s the point behind partial RoPE? It saves some memory. For example, in the MiniMax-M3 example above, rotating half the features reduces the size of the precomputed cosine and sine tables also in half. So, with partial RoPE, instead of 64 columns, now each table only needs 32 columns. However, note that the KV cache still stores the full key and value vectors for each cached token. For MiniMax-M3’s 1M-token context, rotating 64 of the 128 features halves the size of the precomputed cosine and sine tables, saving 0.134 GB (128 MiB) if the tables are stored in BF16. If the tables themselves were stored in NVFP4, the savings would be 0.038 GB (36 MiB), including the block scales. Note that in experiments with 1B to 8B models, the Fractional Rotation, Full Potential? paper found that rotating around 10% of each head’s features often gave similar training loss and benchmark accuracy to full RoPE. However, full RoPE did better on some evaluations. So, in my opinion, partial RoPE is hardly worth it. 6.2 NoPE layers NoPE was coined in the The Impact of Positional Encoding on Length Generalization in Transformers paper and means no explicit positional encoding . The idea or observation is that an attention layer without any explicit position method still has a causal mask, where a query can attend only to itself and earlier tokens. And this causal masking implicitly provides positional information. Let’s use the first four tokens from our earlier example, . In Figure 30, the query for at position 2 can attend to , , and itself. The query for at position 1 can attend to and itself. Figure 30: Example of a causal mask in the attention mechanism. So, the next question is how can the model use the causal mask as a position signal? Here’s a toy example adapted from the paper. Suppose one feature of the value vectors is 1 for and 0 for the other three tokens. Since the input only contains only one , every visible prefix contains exactly one 1. If all non-masked keys get the same attention score, the softmax assigns every visible token equal weight. So at , attention averages 1, 0, and 0, which gives 1/3. At , it averages four values and gets 1/4. In other words, this output feature equals one over the prefix length, which a later layer can use as a signal for position. Figure 31: With uniform attention, the contribution from The shrinks as the prefix grows. The query for fox assigns The a weight of 1/3. Does NoPE work in practice? The researchers of the NoPE paper trained a tiny 107M-parameter decoder-only transformers from scratch on tasks such as copying, sorting, and addition to do some ablation. When they tested the small model on examples longer than those seen during training, interestingly, NoPE ranked first overall across the ten tasks and ahead of RoPE. The researchers behind the NoPE paper also conducted a separate experiment with a larger 1.3B-parameter models trained on code. Here, NoPE also handled contexts beyond the training length, however, its next-token predictions got worse at the longest lengths tested. Some of today’s open-weight LLMs even go so far and use NoPE in all layers. However, nowadays, it’s more common for models to omit RoPE in at least some layers, where layer here means transformer block. To give a concrete example, SmolLM3 (3B parameters) applies RoPE in three layers and skips it in the fourth, repeating that pattern through 36 layers. Interestingly, the SmolLM3 authors mentioned that this layer pattern improved long-context performance. (Also note that any later layer, following the first one, even though it may skip the rotation, still receives the inputs from preceding transformer blocks, so its queries and keys still receive some sort of position information from earlier layers.) Figure 32: SmolLM3’s architecture (left) and the positional method used in each of its 36 transformer blocks (right). Every fourth block skips RoPE. Architecture diagram from my LLM Architecture Gallery . 6.3 Learned relative position bias Before we get to the overview and look at what modern architectures use, there’s one more method to introduce. For instance, Thinky’s Inkling uses a learned relative position bias in both its sliding-window and global attention layers. It computes the usual scaled dot product between a query and key, and then it adds a certain number to that score before the softmax in the attention score computation. That number depends on the query token’s hidden state and how many positions back the key is. Let’s reuse our example sentence, “The red fox jumps over the gray fox.” (It’s the last time, I promise!) In the figure below, the “the” at position 5 is the query and “fox” at position 2 is the key. Inkling then uses the three-position gap between query and key and the hidden state for “the” to compute the bias, then adds it to the scaled dot product. Figure 33: Inkling adds a learned relative position bias to the scaled query-key dot product before softmax. The numbers are illustrative. This is not an entirely new idea. Some of you may recall Google’s popular T5 (Text-to-Text Transfer Transformer) in 2019, which used a simpler version of this idea. Figure 34: The original Inkling (975B) architecture. The learned relative position bias feeds into the attention module. LLM Architecture Gallery 6.4 How these choices appear in recent models Now, after all this build up, the interesting question is: which architecture uses which method? And what are the recent trends? To answer this, I grouped the entries in my LLM Architecture Gallery by their listed release dates and compared the 2025 releases with the earlier and later releases in the 2026 snapshot. Each gallery card counts once, so multiple variants of an architecture can contribute to the results. LLM Architecture Gallery Figure 35: The architecture diagrams illustrate which attention layers use RoPE, and the bars show the share of gallery entries in each category. Diagrams from my LLM Architecture Gallery . As we can see in Figure 35 above, using RoPE in every softmax attention layer is still the most common choice. However, its use fell from 2025 to 2026, and then also in the latter half of 2026, which could be a trend. Consequently, there is a growing number of models that mix RoPE and NoPE. The groups are still small, so it’s hard to say whether these trends will continue. The NoPE only entries were all recurrent hybrids with softmax attention layers that use no explicit positional encoding. The “Other” category here refers to xLSTM 7B (2025) and Inkling (2026). xLSTM has no softmax attention layers. Inkling adds a learned bias to the attention scores before softmax, as we saw in Section 6.3. Among the models that use RoPE, partial RoPE became more common from 2025 to 2026. It went from a minority of the RoPE models in 2025 to a majority in both 2026 groups, as shown in Figure 36. Figure 36: Among gallery entries that use RoPE, partial RoPE rotates a subset of query and key features in at least one attention layer. Full-width entries rotate all query and key features in every layer that uses RoPE. If you’d like to look up an individual model from the 2026 groups, Figure 37 below shows the 2026 gallery overview with the individual architectures labeled by position type. You can also browse the gallery interactively here . Figure 37: The individual 2026 gallery entries behind the two 2026 bars in Figure 35. 7. Final thoughts So, to recap, we discussed GPT-2 and the original transformer that add a position vector to each token embedding before the first transformer block. Then, modern LLMs switched to RoPE, which encodes relative position inside attention by rotating queries and keys. Surprisingly, RoPE remains as the most popular positional embedding method today. Recently, however, Inkling picked up an idea from T5 to add a learned relative position bias to the attention scores before softmax. And then we also have NoPE-RoPE architectures, which omit RoPE in some layers. It may be boring news, but as mentioned before, RoPE is still the predominant position embedding method, and I think this will carry over into 2027 for sure. Perhaps, though, we’ll see more architectures with an Inkling-like design coming up in 2027. While this may sound “boring”, I am glad that I finally got this article on RoPE (and other position info methods) out, after so many years, so that I can add it to my collection of LLM “fundamentals” explainers. If you are interested in the other architecture building blocks of LLMs, I still highly recommend starting with a GPT-2-style model, which will give you a solid understanding of the building blocks with the least amount of friction. And from there, you can then layer on additional methods (such as RoPE). If you’d like to build that GPT-2-style model yourself, my first Build a Large Language Model (From Scratch) book walks through all the building blocks depicted in the figure below. Figure 38: GPT-2 XL provides a baseline for seeing what newer architectures change. LLM Architecture Gallery For the methods that branch off from the GPT-2 baseline, I’ve collected some of my relevant blog articles below, starting with a refresher on self-attention: Self-attention, causal masking, and multi-head attention: Understanding and Coding Self-Attention, Multi-Head Attention, Causal-Attention, and Cross-Attention in LLMs Modern attention variants (GQA, MLA, sliding-window attention, sparse attention, and hybrids): A Visual Guide to Attention Variants in Modern LLMs The KV cache. Understanding and Coding the KV Cache in LLMs from Scratch SwiGLU feed-forward layers and normalization (LayerNorm and RMSNorm): From GPT-2 to gpt-oss: Analyzing the Architectural Advances Mixture-of-experts layers and expert routing. The Big LLM Architecture Comparison Residual connections and DeepSeek’s manifold-constrained hyper-connections (mHC): Recent Developments in LLM Architectures: KV Sharing, mHC, and Compressed Attention Putting some of the pieces together in Qwen3: Understanding and Implementing Qwen3 From Scratch walks through implementing the dense and mixture-of-experts versions in PyTorch.

0 views

I moved 39 repos into a monorepo to boost agentic coding

Hey, what's up? It's Takuya here. I recently moved my projects into a monorepo to speed up my agentic coding. I came across a post by Mitchell Hashimoto . He recently started a new company, Superlogical, which builds Rex , a terminal app designed for working with AI agents. His team is small, and everyone on it is trusted to push commits straight to main. They skip the traditional flow of opening a pull request, waiting for someone to review and approve it, and then merging it. Instead, AI reviews the code before the push, and humans and AI review it again after it lands. Their workflow looks super fast. I'm a big fan of Mitchell, and I admire the quality of his work, like Ghostty. So I trust his technical decisions, including how his company uses AI. His post inspired me a lot and made me rethink my own workflow, starting from how my repositories are structured. Before I started coding with agents, each of my private modules lived in its own repository and was published to npm from there. Development was slower before AI, so I usually focused on one module at a time: make the changes, publish a new version, then update the apps. With semver, a change in one module couldn't unexpectedly break the apps. Many of these packages are shared across multiple projects, so this workflow was crucial for me. When I started using Claude Code, I kept the same structure, and at first it simply sped up my traditional workflow. But the more I relied on agents, the more friction I felt. AI makes a lot of changes, blazingly fast, so my workflow became the bottleneck. I had set up trusted publishing on npm, so GitHub Actions published new versions automatically. Still, after every change to a package, I had to wait for the publish run to finish before an app could use the new version. Agents also make many changes that span multiple modules, and keeping the module structure in shape became painful. Because each task was spread across several repositories, agents often missed shared constants, functions, and APIs. I think my job now is to help AI make fewer mistakes. One way to do that is to give the project a shape where AI can quickly understand the whole picture: where to look and where to add things. That's why I decided to move to a monorepo. The transition wasn't that simple. I have an Electron app, a React Native app, and a web app, each with its own tech stack and package manager (my server-side code stays in its own repos). Most packages used pnpm, but the React Native app used Yarn, so I had AI switch it to pnpm. Some of my repositories are public, as contributions to the open source community: for example, React Native modules and tools that help developers build Inkdrop plugins. Those can't move into a private monorepo. Everything else moved in, and the repository is now a single pnpm workspace. I used to bring each repository in with its full git history. For each repo, it moved every file into its new folder (for example, or ) across all past commits. It also renamed the tags to the format, like , since every repo had its own . And it rewrote bare issue references like in old commit messages to , so they still point to the right repository. Then I merged each rewritten repo into the monorepo with . For the plugin-related repositories, I made a second, public monorepo ( inkdropapp/plugins ). So now there are two monorepos, and the release flow looks like this: With everything in one repo, I could also unify the toolchain. Some modules still used ESLint and Prettier, so I migrated them all to Oxlint and Oxfmt, which now run once from the root. I also tried Vite+ , a unified toolchain that bundles Vite, Vitest, Oxlint and Oxfmt behind a single command. I was already using most of these tools in my modules, so switching looked easy, and its task caching promised a faster loop with agents. But in my case, its type-check cache reported a broken TypeScript 7 project as passing. With agents, that's risky: they see a green check and move on. There also wasn't much build time to save in the first place, so I decided not to go with it. I'll try it again in the future. This work took two days to finish, and I'm happy with the result. Now, my agent and I can quickly update modules and keep them aligned in a single change, and I can comfortably create a git worktree for each task. Before the move, a task that touched several repositories needed a worktree in each of them, and that was painful. So, this transition has already paid off. Inkdrop's codebase is over 10 years old. If you also have an old project split across many repositories, I hope this helps you rethink how you work with agents. I have so many ideas to improve my app, and I'm so excited to work on them starting next week. That's it! Thank you for reading.

0 views
Lea Verou 6 days ago

Candidate Statement for the 2026 W3C TAG Election

Group photo of the W3C TAG in July 2022 with me to the left of Sir Tim Berners-Lee (inventor of the Web and TAG chair emeritus). Photo credit: Dan Appelquist I had the great honor of being elected to the TAG by the W3C membership in 2020 and again in 2022 , serving two terms from 2021 to 2025. After a two-year break, this year I’m running to return, thanks to Google, Microsoft, and OpenJS Foundation pooling resources to make it possible. 💙 The W3C Technical Architecture Group (TAG) is the Working Group that ensures that Web Platform technologies are usable and follow consistent design principles, whether they are created inside or outside W3C. It advocates for the needs of everyone who uses the Web and everyone who works on the Web. If you work for a company that is a  W3C Member , please consider encouraging your AC rep to vote for me ! (Ask me if you don’t know who that is) My candidate statement follows. I’m Lea , and I’m running to return to the TAG, where I served two terms from 2021 to 2025. It was some of the most fulfilling work of my career. The only reason I did not run in 2024 is that the job takes hundreds of hours a year, which as an independent I could not sustain pro bono. This year, in recognition of my service, Google, Microsoft, and the OpenJS Foundation have pooled resources to fully fund my participation , so I can finally commit the time the job deserves while remaining independent . My work spans the entire web platform : 14 years in the CSS Working Group, active participation in TC39 and WHATWG, two decades of building for the web, and open source running on millions of websites. In 2025 the OpenJS Foundation recognized my overall impact on the web platform with its Pathfinder for Standards Award . That breadth is exactly what the TAG requires. With a PhD in Human-Computer Interaction from MIT and a 20+ year career that includes entrepreneurship and product leadership, I combine academic rigor and big-picture perspective with pragmatism , an eye for hard tradeoffs , and a deep commitment to user needs . And as a bilingual Greek woman, I bring a Mediterranean and European perspective and firsthand appreciation of the Web’s internationalization needs. For more on my background, see my 2020 and 2022 candidate statements. In my four years on the TAG, I worked to direct the group’s limited time towards maximizing impact: I co-led the Web Platform Design Principles , turning previously implicit design knowledge into published guidance that improves consistency across the platform and helps reviews scale, started the Web Platform Gaps initiative to find what the platform is missing, served as liaison to TC39 to keep JavaScript and Web APIs consistent, and participated in hundreds of design reviews, becoming the TAG’s go-to reviewer for API design. But I believe the TAG can, and should , do more. The Web is changing rapidly, and reactive review is no longer enough. The TAG is uniquely positioned to see the platform as a whole, yet it mostly encounters features after their architecture has taken shape, sometimes even after they ship. By then, consequential decisions are difficult to change. Who identifies gaps that span multiple working groups? Who sketches the big cross-cutting solutions, or decides which layer a problem belongs in when that is non-obvious? Individual groups see their own slice, and the sum of several low-level views is not the big picture. The result is architectural debt . I want the TAG to help shape the architecture of the Web, not just review it. To proactively identify gaps, sketch coherent, composable solutions, and then bring the relevant working groups into the conversation to develop and standardize the pieces within their scope. Not to take over their work, but to provide the cross-cutting architectural perspective that no individual group is positioned to offer. Expanding the gap analysis work I began last term is the first step, and my work since then has given me a much richer evidence base to draw from. I am one of the people leading Modern Web Guidance , a multi-vendor project teaching AI coding agents to use the modern web platform effectively and follow best practices. This work involves reviewing implementation instructions for a broad range of use cases, ensuring they reflect the best the modern Web has to offer. This makes the many ways the web platform still falls short incredibly salient, revealing systemic gaps that are easy to miss when looking at web features in isolation. The biggest change since my last term is that a growing share of the code targeting the web platform is written by AI agents , and a growing share of the Web is consumed by them. The TAG should treat this as an architecture question and answer it with principles and evidence, not enthusiasm or alarm. Many of the principles that make APIs robust and usable for humans also benefit agents, but the differences expose new tradeoffs that deserve careful architectural attention. And none of this changes what the Web is for: user agency, privacy, accessibility, and interoperability apply no matter who, or what, writes the code, and defending them is the TAG’s job. I am not employed by a browser vendor or a big tech company, and my funders do not direct, approve, or veto my positions. I remain free to disagree with any of them, in public, on any proposal. My only agenda is a web platform that lives up to its potential and remains owned by no one . I’ve spent four years helping the TAG improve the Web. I want to help it shape the Web’s future, and for the first time, I have the resources to see it through. I would like to thank the OpenJS Foundation, Google, and Microsoft for fully funding my TAG participation in the event that I am elected, and OpenJS Foundation and Bocoup for partly funding it during my previous terms.

0 views
Jim Nielsen 6 days ago

Making a Website in 2026

Pete Millspaugh has a great post over on the Val Town blog where he documents his attempt at making generating the same website across a variety of AI tools. I love the post. Here are a couple of thoughts that come to mind. Pete decided to make a website for his conference talk, and he added a comments section to make it a less static / more dynamic demo. This is interesting because LLMs are really good at generating one-off HTML pages you open at , but as soon as you start to introduce technological dependencies — like a database, or an analytics tool, or a service for sending email, or payment processing, etc. — the question becomes: How does the LLM choose which service to rely on? It’s one thing to have the LLM choose React over Angular or Vue over Svelte. But how (and why) does it choose something like an auth provider? Does it build you a site with Auth0 or WorkOS or Clerk? How would a non-technical user even know how to weigh the trade-offs of making such a decision? Pete said he was deliberately vague about these details, which is why I find his experience so intriguing. For example, here’s what he found after generating a site in Lovable: My Lovable app is fullstack React, I learn, clicking around to find the code. It seems a bit heavy for a single-page site what with dozens of files […] The comments database seems to be using Supabase, which required no intervention on my part to set up. There’s a whole lot more—analytics, e-commerce and AI integrations, etc. I’d be really curious to know what that “a whole lot more” was. Which tools/services did it choose to depend on? How many people creating these sites understand that, even for a website that’s mostly static content, they’re being given an output that ships a JavaScript application framework, router, hydration runtime, analytics, component bundles, etc.? You asked for a sailboat, but you got an aircraft carrier . Do you know? Or more importantly, do you care ? But it’s more than just a choice of languages and frameworks. It’s also a choice of third-party services. Why Supabase? Why not Firebase? Or Neon? Speaking of Neon, here’s Pete’s experience with Vercel’s v0: I copy-paste my prompt into the chatbox. After 11 seconds, v0 asks if I’d like to install Neon, because my comment wall needs a real database. Sure, why not. (Does that mean I need a separate Neon account? Vercel creates one for me, and later I’ll find a welcome email from Neon in my inbox.) Frankly, this all feels like a space absolutely ripe for those kinds of business referral transactions you find in other industries. Take real estate, for example. For lots of folks, when you buy a home you need an agent. (Not that kind of agent; a real estate agent.) Your real estate agent is there to help you answer all those common questions that come along with buying a home: While you’re free to make all these decisions yourself, your agent is also there to help you pick. Presumably they’ll choose a company that reflects well on them, but there’s also undoubtedly good money to be made in referrals. After all, who else is dealing with people with these kinds of needs all day long? The “make a website with AI” space has a parallel here which makes you wonder about the incentives behind the LLM’s decision-making. Why Supabase over Firebase? Because the LLM reasoned about it? Because, statistically speaking, it was the next most probable word? Because Supabase paid Lovable (and hopefully disclosed such preferential integrations)? If LLMs are already unpredictable and non-deterministic, nothing will make their actions more predictable and deterministic than some financial incentives. Who is the customer here? The person generating the website? Or the company willing to pay for its services to be embedded in generated code? (That’s a lucrative business waiting to happen…) As a customer, the credit systems behind these LLM systems are annoying as hell. Here’s Pete: I’m using up “credits” as the machine works—0.70 so far, now 2.30, now 3.10, oh boy—and I have no clue what that means. There are no units. I’d prefer dollars. Are credits just dollars? As it turns out, no. With another tool: I do two more rounds of click “Continue generation” and wait until my website is ready: 5 minutes 36 seconds for 0.070 credits, and 1 minute 29 seconds for 0.024 credits. It’s probably just me, but c’mon, who do these “credit” systems really benefit? When my prompt is running, don’t show me usage like this: Credits: 0.05 -> 0.0672 -> 0.0871 Just show me the cost: Cost: $0.02 -> $0.21 -> $0.31 Don’t make me do the conversion of credits -> dollars on the fly. Computers are good at math. I know it might hurt your bottom line if I’m not thinking about how much money credits I’m spending, but c’mon, can we stop with the financial abstraction on top of financial abstraction? I hate how so many hosting companies are doing this “credits” for compute primitives thing. It’s pitched as if spending credits is easier, because you can apply them across services, e.g. buy image transformations or serverless function compute, all with credits! Yeah well guess what other financial abstraction I can apply to all those different services? Dollars and cents. [/soap-box] Pete’s conclusion: I am both optimistic and pessimistic about this moment for making websites. I’m optimistic because end-user programming, the idea that everyone should be able to customize their own software, seems more possible than ever. I’m pessimistic because a slopsite, an AI-generated website with little to no human thinking involved, is often worse than no website at all. That resonates — and feels generalizable. You fill in the blank: An AI-generated ___ with little to no human thinking involved, is often worse than no ___ at all. My conclusion? Making Generating a website may be easier than ever. Understanding what you’ve generated, who you now depend on, and why? Not so much. Reply via: Email · Mastodon · Bluesky You: “How do I finance this?” Agent: “I know a mortgage company…” You: “How do I know the house is in good shape?” Agent: “I know an inspection company…” You: “We found X during the inspection, who can address it?” Agent: “I know a company that does {roofing | electrical | plumbing | etc.}…” You: “How do I close on this deal?” Agent: “I know a title company…”

0 views
Simon Willison 1 weeks ago

Locating the source of a mysterious beep with Claude

Our house has a box room, full of boxes that we still haven't unpacked from our last move. A couple of weeks ago something in that room started intermittently beeping . The beeps were far enough apart that standing in the room and trying to determine the source of the noise was frustrating, and I really didn't want to dig through every one of those boxes. So I had Claude Code build Beep Locator , a software system for triangulating the source of a mysterious beep using multiple devices scattered around the room. Here's what Beep Locator looks like after it has been running for a while: You run Python web server to show the primary UI, and then use the QR code or URL to connect as many devices as you can spare to act as listeners - I was using two iPads, a phone, a MacBook Pro and a Surface Ultra. The devices then play noises to each other to help estimate their locations. This didn't work particularly well, so I added a "Rough mode" where you can drag their icons around in the space to provide rough locations which are then adjusted based on those sounds. Once that's set up, the devices all listen for the beep! I added a clapping mode too so I could test it by clapping my hands in different locations around the room - displayed as diamonds on the map. This helped me gain confidence that it was capable of locating a sound. Beeps show up on the map as an X, plus a line in the "Sounds located" log. You can replay these sounds (from each device in turn) to confirm they are the mysterious beep you are looking for, then click "This is the mystery beep" to mark them as such. Once you've confirmed the mysterious beep frequency the system will listen out for it, measure the interval between beeps, and use the triangulated locations to lock down the most likely location on the map. The system worked as intended. It gave me the position of the beep to within about 40cm, then I dug through that specific pile of boxes and found an ancient carbon monoxide detector that desperately wanted its batteries replaced. When I started working through this problem with Claude it quickly dug up BeepBeep: A High-Accuracy Acoustic-Based System for Ranging and Localization Using COTS Devices , a 2007 paper by Chunyi Peng, Guobin Shen, Yongguang Zhang, Yanlin Li, and Kun Tan. Here's that paper's abstract: We present the design, implementation, and evaluation of BeepBeep, a high-accuracy acoustic-based ranging system. It operates in a spontaneous, ad-hoc, and device-to-device context without leveraging any pre-planned infrastructure. It is a pure software-based solution and uses only the most basic set of commodity hardware – a speaker, a microphone, and some form of device-to-device communication – so that it is readily applicable to many low-cost sensor platforms and to most commercial-off-the-shelf mobile devices like cell phones and PDAs. It achieves high accuracy through a combination of three techniques: two-way sensing, self-recording, and sample counting. That sounded exactly like what we needed to build! Beep Locator runs a Python web application server that does most of the work. The listening devices then connect to that server via WebSockets and present a UI which requests browser microphone access. The listeners mainly work by recording a 60 second buffer of recent audio. They also run a simple beep detection algorithm (see detector.js ), which uses Fast Fourier Transform and a high-pass filter to identify potential beeps. It sends these events to the main server. When a beep is reported, the server has a device play a short chirp (the device with the lowest round-trip time to the server), then asks every listener upload a clip from about 0.6s before the beep to 0.8s after that chirp. This chirp allows the clips to be aligned with each other, a crucial step in locating the beep. I started this project using Claude Code Cloud via my iPhone, with Opus 5.5 running in Extra thinking effort mode. Here's that shared starter session , which began with this prompt against a newly created empty GitHub repository: That got me this problem.md file . As part of writing that up Claude found and read the BeepBeep paper, which is described in that file. The research looked good, so I told it: That got me to this point - most of the system was built, but nothing had actually tried running it yet. I cloned the new repository to my laptop and fired up Claude Code... and then Fable 5.2 was released , and this project seemed like an excellent opportunity to put that through its paces. I had Claude Code on my laptop start the server running, then made sure it could both see what was happening and make live changes to the software as it ran. This was already baked into the software: Opus 5.5 had built an installModule() method on the listeners that could be triggered over the WebSocket connection, meaning the admin server could execute arbitrary new code on any of its clients. On some devices, web pages that listen on the microphone request user permission any time the page reloads. The hot-swap module mechanism meant that we could deploy new code without having to manually interact with each of the listening devices in turn. From that point on my involvement was mainly to sit by the laptop chatting with Fable 5.2 about what was going on, and occasionally requesting new features. Here are some of the feature prompts I ran: This gave me the ability to drag listeners around the map. That added the thing where any time I clapped it would show on the map as a different symbol from the beeps. That made it easier to spot which symbol likely reflected which real-world sound. Now I could replay sounds, making it much easier to identify which recorded clip was the mysterious beep I was looking for. At this point I was getting close - I had a solid idea of where the beep was coming from, but wouldn't it be neat if I could reposition the listeners around that point to get an even finer location? And since I had one spare device, I then said: I think the most interesting part of this project is that I demonstrated it's possible to give Claude Code ears . Claude doesn't have native audio input (yet), but it can run JavaScript and Python code that can analyze audio captured by a microphone. I told it to run a web server with WebSocket connections to multiple listening devices, then had it both run a WebAudio microphone on those devices and hook them up so they could be sent fresh JavaScript code to execute via that WebSocket. Then I could pretty much leave Claude alone, hacking away at the problem, querying the audio logs, and reconfiguring its ears to help it solve the problem. I'm reminded of a similar hack I heard about at GitHub Universe a few weeks ago, where Martin Woodward told me he had been debugging the GitHub Universe Badge computers by plugging them into a computer via USB-C and then pointing a webcam at their screen, so his coding agent could tell if updates were working correctly or not. Figuring out ways to let coding agents perceive the world around them is a whole lot of fun. You are only seeing the long-form articles from my blog. Subscribe to /atom/everything/ to get all of my posts, or take a look at my other subscription options .

0 views
David Bushell 1 weeks ago

I was wrong about dark mode

Apple invented dark mode again! They’re calling the new feature Adaptive Dark Mode ™ . I’m learning that other browsers already had a similar feature . I assumed people relied on add-ons like Dark Reader (and millions do). Regardless, pushing what is effectively an accessibility option to the forefront goes a long way to help people respect it. My site used to have dark mode but I wasn’t happy with my colour choice and implementation. I redesigned my site back in Feb and removed it. Later I experimented with colour themes which I’ve since adapted for alternate blog banners . In that experiment I said: Personally I prefer reading with a dark theme for long-form content. Dark is not my brand though and I don’t believe every website needs to support colour scheme preference automatically. A good browser has reader mode, I use that all the time. “Just enabled reader mode!” What a load of rubbish. You have to understand that sometimes I just write stuff and I don’t read it back. This also contradicted my previous statement: That said, in [current year] brands with a digital presence — all of them? — should have a colour scheme for both. That’s probably more true. Certainly websites must work for forced dark mode. (Any site forcing itself upon users should go straight to jail.) So either provide a dark mode, or be prepared to test against every adaptive and forced dark mode implementation, or just let your website look broken. Probably easier to design a dark mode then? So that’s what I did, again. Maybe you noticed? If not, there’s a toggle button up top. At the risk of weighing in on the conversation I’ve opted for a two-state single button. I default to system preference. The mystery button flips between light and dark. Want to return to system default? Tough luck! You shouldn’t have clicked it. Delete local storage nerd! Technically I’m using a registered custom property with container style queries because it looks like fancy modern CSS. Three at-rules! Most of my light/dark theming is done by customs properties. The default light colours (A) are set on the root element. A style query applies the dark colours (B) on the element. For edge cases that don’t follow the A/B rule I can use one of two techniques. Either a style query inside a specific component: Or use the function: Note that I set to make aware of the user’s choice that might override their system preference. I wonder if I can do this once: Is that safe? Let me know! It’s not safe to do on the root element because browsers checks that for adaptive dark mode etc. I’ll stick to the verbose style queries for now until I’m sure. There’s a sprinkle of JavaScript to use local storage for the toggle button. It’d be better to use a cookie and a server-side template. My website is hosted on a static CDN and I’m not adding edge worker latency, so I’ll risk Flash of inAccurate coloR Theme (FART) . My site only risks a FART if a user’s choice doesn’t match their system preference. A week into my Noscript November experiment I see most websites are prone to a big FART because they rely entirely on JavaScript to enable dark mode. I’m not happy with my button using a hidden label. Bit of a design failure I need to address later. My original goal was to have multiple themes but I ran out of time. At the risk of soliciting replies to a question I didn’t ask, I would like your feedback on my choice of dark mode colours! Do they look nice? I don’t care whether dark mode makes your eyes bleed (turn it off) or you absolutely must have a 4-dimensional toggle. Stephanie Eckles wrote about the same CSS technique I use. Dave Rupert has explored the with variations. I saw Una Kravets is using with style queries to do something extra fancy. Stu Robson has written in depth on dynamic colour schemes too. If you read this entire post in an RSS reader and never clicked through, what a power move! Thanks for reading! Follow me on Mastodon and Bluesky . Subscribe to my Blog and Notes or Combined feeds.

0 views
Simon Willison 1 weeks ago

Hide your slop PR descriptions behind <details><summary>

Most of the changes I make to my projects these days come in the form of PRs opened for me by Claude Code or Codex. The PR is my unit of work - I use them to bundle commits together, iterating on them until a feature is complete, document decisions and then merge the finished result. Today's coding agents are great at writing PR descriptions. The problem is that they are too good. An agent-written PR description is accurate and comprehensive. It describes the problem, the detailed solution, and the steps taken to verify it. That's a lot of information to absorb. It's not necessarily slop, but it reads like slop! It's very easy to spot an AI-written PR, and as with other forms of AI writing my instant reaction is best summarized as "I'm not reading all of that". It doesn't matter how accurate or useful the information is, I'm instantly put off by the thought that it will take me longer to read than it took the driving author to write... even when that driving author is me! I want human editorial judgement. I want someone to have thought just long enough about the PR to give me a human-approved introduction that helps me understand, at a high level, what the PR is for and whether it deserves more of my attention. I think I've found a low-effort way to do this that feels right. The HTML elements render as a collapsed heading (the summary) that can be expanded to view the larger piece of text. The code looks like this: When rendered, it looks like this : Crucially, is supported in GitHub Markdown . You can drop those tags directly into an issue comment or PR description and GitHub will hide the details and display just the summary plus an expansion arrow. I've started using this for my AI-generated pull requests. The opening paragraph of my PRs will be carefully selected to act as a high-level explanation of what's going on - the shortest text a human can read that will help get them up to speed. I'll sometimes throw in a screenshot as well, since images are often the best way to quickly illustrate a new feature. The full agent-written essay then follows in a . I use the model name and often the effort level as that summary, to make it abundantly clear what is going on - "Claude Opus 5.5 Medium" for example. My PRs don't feel nearly as sloppy now! The information is all still there, but a reader can glance at it and get the top, human-curated information without their eyes glazing over at multiple paragraphs of agent-written details. I don't always write the introduction myself - sometimes the agent has given me what I need already, hidden away in the avalanche of other text. My promise to the reader is that the short opener will represent my human judgement as to what is definitely worth their time. Here are some recent examples where I've used this pattern, including the opener I used: I used to have trouble remembering the order of the tags - is it or ? Here are two tricks that helped me. First, and most obviously, the is clearly the bit where you summarize the details. That's the tag for your line of text that can be clicked to expand - the element must then wrap everything else. An even better trick is to always refer to these two tags as "details-summary". "details-summary" is two syllables followed by three syllables. That rolls off the tongue more smoothly than the three-two punch of "summary-details". Say "details-summary" out loud just a few times and you'll never forget the order of the tags again. (I still wish GitHub would add a button to their Markdown editor for this - partly to save me painstakingly typing it on my mobile keyboard, and partly to help spread the word to more GitHub users that this feature exists.) You are only seeing the long-form articles from my blog. Subscribe to /atom/everything/ to get all of my posts, or take a look at my other subscription options . datasette PR #3052: Redesign row page as a vertical list of fields - "The row page showed its single row as a one-row table. For wide tables, like a 46-column GitHub table, that scrolled far off to the right and left most of the page blank." (then a screenshot) datasette PR #3043: Pagination bar showing which rows are on the current page - "Table pages that span more than one page now make it obvious where you are, and offer navigation at the top of the page as well as the bottom." (plus screenshot) datasette PR #3042: Load edit-tools.js on demand via a small loader - " (~220KB) was loaded on every table, row and database page, even for users who couldn't edit anything. Now only load it for users who can edit when they first interact with an edit feature (including mouse over an edit link)." datasette-agent PR #51: register_agent_reference_types plugin hook - "Lets plugins add their own kinds of item to the tagging in the chat composer using a new plugin hook." - pictured above. llm PR #1838: Add llm openai endpoint add/list/remove/path commands - "Adds commands for managing the records in , so OpenAI-compatible endpoints can be saved from the command line instead of by hand-editing YAML." - then copied output.

0 views
Sean Goedecke 1 weeks ago

LLMs are terrible at designing AI systems

LLMs don’t know how to design software that uses LLMs. They’re comfortable writing normal programs, but if you throw an AI-shaped problem at them, they will usually screw it up. Why is that? For example, this post describes an attempt to vibe-code a memory tool that would flag when one memory contradicted another 1 . This is a great instance of a task that was virtually impossible five years ago but is now relatively trivial due to LLMs. You can simply task a LLM with scanning for contradictions, either in a big batch or pairwise 2 . However, when asked for the “state of the art” approach 3 , the AI agent in this case did not recommend LLMs. It started building a bewilderingly complex symbolic system to convert the memory items into structured logical atoms , then mechanically compare them with a solver. This, of course, did not and could not work, because there is no analytic way of determining whether any two natural-language sentences express the same proposition. The LLM knew this was impossible! When the user eventually lost patience and said “hey, why isn’t this working”, Claude immediately explained that this was a known 130-year-old problem with no solution. And yet it happily went around and around for weeks iterating on a dead end. I’ve run into this myself. When I was building Autodeck (AI-generated spaced repetition cards) my agents would routinely try to categorize cards by regex or keyword search instead of just making another LLM call. Why would this be happening? I have two obvious explanations and one deeper one. The first obvious explanation is that most training code is pre-LLMs . Assuming the labs aren’t feeding the current avalance of slop repositories directly into the models 4 , the vast majority of the code that models learn from was written before LLMs were an option. So it would make sense that they’d reach for non-LLM approaches, in the same way that they’d reach for jQuery over modern vanilla JS, or Backbone.js over React, right? Wrong, actually! LLMs don’t choose jQuery and Backbone. Whatever part of the training process pushes them towards up-to-date knowledge in other areas isn’t successfully pushing them towards LLMs, so this can’t be the whole story. The second obvious explanation is that RLVR is not a good environment to write code that calls LLMs . Much of the time LLMs spend training is spent in reinforcement learning environments where an automatic grader determines their performance (for instance, by running some code they wrote and checking the outputs). I don’t know this for a fact, but I would be surprised if these environments contained the credentials and API access for a LLM to call other LLMs 5 . So even if the pretrained LLM was comfortable writing that kind of code, the reinforcement learning process might discourage 6 it from doing so. The third explanation, which I like the most, is that current AI agents are just not very good at software design . On this explanation, picking a doomed symbolic approach instead of simply calling a LLM is not a weird aberration but a normal instance of AI agents picking the wrong tool for the job. I’ve seen this behavior from LLMs in other contexts too: trying to build complex (and doomed) consensus algorithms instead of tolerating stale data, introducing synchronous checks in event-driven systems, and so on. In the past I’ve chalked these up to alignment , but I’m open to the idea that they’re just ordinary errors of software design. One lesson I learn over and over again is that I can’t judge a LLM by the standards of a human. Any human programmer who was capable of implementing a sophisticated symbolic solver would know that it wouldn’t work, and so if they suggested that approach I’d assume 7 they had a good reason. Only a LLM could be both smart enough and dumb enough to make this mistake. I write a lot about the skills that are involved in working effectively with LLMs. I still stand by what I wrote in February 2025 : Using LLMs well involves extracting value from what they’re good at and avoiding wasting time at what they’re bad at. This is surprisingly hard, because of the point above. LLMs are good and bad seemingly at random: they will work hard for hours but sometimes be shockingly low-effort , they will draw on inhumanly broad expertise but fail to apply the most basic common-sense, they can successfully rewrite enormously complex programs but will often make very silly errors in design. If you can predict where they will do well or badly ahead of time, you can get enormous value from LLMs; if you can’t, you will likely waste a lot of time and tokens going down hopeless approaches. Here’s another example where the user “implied” that Opus 5.5 should use a judge model and it instead constructed a series of regex checks. Here I’d probably reach for a decision model . In hindsight, this was probably the key mistake, though I don’t know how you’d turn that into advice for non-technical vibe-coders. Never asking the agent about the state of the field is a mistake too. Put one more notch on the LLMs reward expertise belt. A fair assumption, I think: even though training on low-quality synthetic data clearly isn’t catastrophic for LLMs, it can’t be great . It would be expensive, slow, and risky. This theory also explains why LLMs are great at prompting other LLMs as subagents, or on training LLMs from scratch: they’re likely directly RL-ed and evaluated on that, unlike on writing code that calls LLMs. Well, okay, I wouldn’t — I’m arrogant enough to ask anyway — but I’d at least expect a good reason. Here’s another example where the user “implied” that Opus 5.5 should use a judge model and it instead constructed a series of regex checks. ↩ Here I’d probably reach for a decision model . ↩ In hindsight, this was probably the key mistake, though I don’t know how you’d turn that into advice for non-technical vibe-coders. Never asking the agent about the state of the field is a mistake too. Put one more notch on the LLMs reward expertise belt. ↩ A fair assumption, I think: even though training on low-quality synthetic data clearly isn’t catastrophic for LLMs, it can’t be great . ↩ It would be expensive, slow, and risky. ↩ This theory also explains why LLMs are great at prompting other LLMs as subagents, or on training LLMs from scratch: they’re likely directly RL-ed and evaluated on that, unlike on writing code that calls LLMs. ↩ Well, okay, I wouldn’t — I’m arrogant enough to ask anyway — but I’d at least expect a good reason. ↩

0 views
Fredrik Meyer 1 weeks ago

AI tools I use (2026)

Over a year ago I wrote the post All the ways I use AI . A lot has happened in the AI space since then, so in this post I will summarize how I use AI now, in November 2026. For context, I am a software developer, these days mostly coding in Kotlin and Next.js (same as last year). (I did not use AI to write this post. I did ask AI for typos and suggestions, but all words are my own.) In rough order, from most used to least used, here are the tools I use these days: At work we’re currently only allowed to use AI models through GitHub Copilot (which includes both OpenAI’s models and Anthropic models). I mostly use it sandboxed with , a sandbox for running agents in. How I do AI coding deserves its own post, so I’ll just list some bullet points of usages I like, coding-wise: I don’t like having AI write documentation. Reading AI-written text is somehow very demanding. It invents phrases, and over-uses some other ones (“gate”, “not this, but that”, and so on). Lately I’ve been also using it through agent-shell , a really well-designed Emacs package, which lets one use agents directly in Emacs (since one can specify the command to start the ACP server, it can still run in the sandbox). (actually - with the help of AI, configuring Emacs has gotten so much easier!) It is very handy for help in everything from cooking (“I have these ingredients, suggestions for what to make?”) to helping me buy a new computer (“I am considering a home server, what do I need?”). I have admittedly asked it a few health questions, but then I always ask it to back up its claims with peer-reviewed sources. Some sample conversations I’ve had: I still use Raycast as a Spotlight replacement (though I am considering replacing it with tinycast , a smaller open source alternative). If I have a very quick question I can press ⌥+SPACE TAB , and read the answer there 1 . So I basically just use it for small chats. I really disliked Google pushing AI search results on people before, but this has actually turned out quite good. For quick searches, it is often faster to just talk to the search result. The biggest downside is that it very often lists Facebook posts and Instagram videos as sources of its claims, so don’t trust it immediately. AI can be problematic for many reasons, and I think practicing intentional use will be extremely important onwards (just as with social media). We will have to learn to fight the urge to have an agent solve every problem - sometimes our understanding is the goal (more than a quick solution). It is probably not healthy to outsource thinking and problem solving. Skills and knowledge will atrophy if not used 2 . Personally I try to avoid AI on hobby projects, mostly because the fun and learning go away (though I do have a fully vibe-coded hobby project). When text is so cheap, we end up producing a lot of it. It is scary to think about a future where almost all text is produced and read by AI. Where do humans fit in the picture? I have not tried tools like OpenClaw to automate everything in my life, but I assume I will at some point (when they are sufficiently reliable, maybe). It would be interesting to experiment with having an always-on agent. At work, it could be useful for reacting to things happening in production, or reacting to review comments, for example. Finally, I am excited about how the AI landscape look in a year’s time (and are any of them profitable yet ?) I still haven’t installed Raycast v2, which supposedly has a lot of changes.  ↩ This piece by Addy Osmani is a nice read.  ↩ Map out codebases, point out holes in documentation, point out bugs. Write tests (though models tend to write very verbose - often trivial - tests, so be vigilant). Reproduce bugs, fix them with a failing test. At Nav, where I work, agents can read logs and traces, which can be very helpful when debugging. They have a skill for this. Write code, of course. Help me choose a hanging chair for my balcony Salad ideas, suggestions for burger fillings What Linux OS to use for gaming Help me solve traffic in Cities: Skylines I still haven’t installed Raycast v2, which supposedly has a lot of changes.  ↩ This piece by Addy Osmani is a nice read.  ↩

0 views
iDiallo 2 weeks ago

College will only cost $20 a month

From 2020 to 2022, I've encouraged a steady stream of students to pursue their education in computer science. Tech companies were hiring like crazy. I would interview 3 candidates a week on some occasions. The future of tech seemed to be paved with gold. Any day now, several of those students will graduate. I dread opening my inbox and get an email from them asking: "So... about those jobs?" Things have changed since those crazy old days. Hiring has come to a stop. Those graduates will step into a market that looks nothing like what they signed up for. Getting a job will be a struggle. If I could see the future, I would have recommended a different path. But then again, how could I have known? Hindsight is always 20/20. So this leaves me with a dilemma as a parent. What do I tell my own kids? Am I going to push them to pursue the same traditional colleges? Will I disburse life savings so they could attend a prestigious university? Or will I just buy them a $20 a month AI Subscription? Imagine handing a student a textbook straight from a university syllabus. They read a lesson, and then you have an AI tutor to quiz them, debate concepts, and break down difficult ideas until they fully grasp the material. Is that a good replacement for college? Some argue that college is about the experience. It's the friendships you make along the way, the networking, the independence. These same people often omit the lifetime of crippling debt that hangs over those friends twenty years later. When I was in college, I focused almost entirely on mastering the material in the books, completing all assignments quickly. I spent the rest of the semesters tutoring my peers and applying the material I had learned. For me replacing the entire college system, the brick-and-mortar university with a set of books and an AI subscription seems like it would have done the job. I was the target candidate for this model. Yet, now that I have these AIs to experiment it myself, I found two flaws in the model: When I wrestled with dense textbooks in college, solutions didn't arrive at the click of a button. Instead, I struggled. I hit dead ends. I tried solutions that seemed promising only to abruptly stop two hours in the process only to realize that the whole thing was wrong. Sitting with the problem, the trials, the errors, giving up and going for a walk to clear my head, that was the process that taught me how to think. It taught me how to debug. Even when I found solutions online and pasted them into my code, I had to encounter the same problem repeatedly before the concept finally made sense. You have to work your way through a solution to understand a problem . This is why I feel concerned when we throw Millennium Prize Mathematical problems at AI. Imagine an AI presents a complete proof to one of these unsolved problems tomorrow? If or when AI solves it, we still have two problems. The second one is often overlooked, but ask yourself, where do these problems in Mathematics come from? They come from mathematicians attempting to solve hard problems, taking detours and failing along the way. Remove that step, and you... Well, you don't find any new problems. Not just in mathematics, I feel we will see something similar in code where fewer applications rely on frameworks . Frameworks solve real issues in programming, but why use a framework when the AI can just give you all the answers. I lived through the JS framework mania. I am not suggesting we create more, but I think we will miss out on discovering new problems that need solving. If we rely on a system that just hands us a solution, we lose the ability to uncover new questions because we never went through the steps of trying something new. I don't think a $20-a-month AI subscription paired with a textbook is the ultimate solution. Not when we still need some friction in order to inculcate concepts in our minds. But traditional higher education has changed so drastically and the skyrocketing costs and changing employment realities don’t help. There is no turning back to the old model either. The challenge for learning remains understanding. How we grasp concepts and develop critical thinking in an era of instant answers. Maybe that's where we should turn our focus to. Figuring out how to design learning that somehow preserves productive struggle. If AI can solve this issue and turn students into masters of crafts instead of prompt engineers, I mean, I'll gladly keep that college tuition in my pocket. Understanding takes time. Not having an immediate answer forces you to strain your brain until you figure things out. We still have to understand the solution. Having an AI produce a proof doesn't mean we understand how or why it works. We don't get to discover new problems.

0 views
Simon Willison 2 weeks ago

The October inflection point for vibe game development

I've written before about how November 2025 was an inflection point for coding agents - the point where Opus 4.5 and GPT-5.1 crossed a tipping point that meant their respective coding agents became reliable daily drivers for software engineers. I think we've reached a new inflection point in October 2026, and this time it's for vibe coding computer games . Claude Opus 5.5 in particular exhibits meaningful improvements in several areas needed to build a compelling game: That last one is particularly important. Models have been able to create something that looks like a game for quite a while now, as seen in my previous experiments . The challenge has been getting to a game that's actually fun to play . Game design is a deep subject area. I won't pretend to be well versed in it - I know enough to have respect for it as a craft. Creating a novel, compelling gameplay loop which challenges players at the right level and provides a satisfying learning curve is a fine art. I didn't think the models could do it. Then I tried telling Claude Opus 5.5 to "Make it a LOT more fun"... and it did . In the past few weeks I've vibe coded (in the classic sense of the term - no looking at the code at all) four games that I've genuinely enjoyed playing. I attended Foo Camp in Berkeley over the weekend and met several people who were having similar experiences. Building games that play well is shockingly easy now. The new challenge is coming up with concepts for games that are novel and delightful and that wouldn't exist without AI assistance. I haven't done an exhaustive study, but my current impression is that GPT-6 Astra isn't quite there yet. It can absolutely build a game, but its sense of fun doesn't match that of Opus 5.5. I expect OpenAI will get there by the end of the year. Here are the four game projects that have convinced me that the models are now capable of producing fun games with very little guidance. All four are built in HTML and JavaScript and run entirely in the browser. The smallest game I found to be genuinely delightful is Tree Appreciator . I used the regular Claude chat interface for this - it didn't even need Claude Code. I built this on a whim while we were driving along Skyline Boulevard looking at trees. My prompt was: I've found that telling models to use three.js works really well. Claude doesn't have its own image generation model but is capable of building full-color 3D models that look and feel excellent. This game required no iteration or follow-up prompting at all - I got the game in a single shot. It gave me back a charming little mobile-friendly spot-the-difference game. You can play that here . Here's the chat transcript that built it. It's pleasingly relaxing. The graphics are fun, and collecting trees that you have completed in a "herbarium" provides a nice, cosy sense of accomplishment. This was a more ambitious project that I again built using regular Claude chat. I started out by building an experimental prototype of an engine for a top-down fantasy RPG: Here's that first version . It worked really well! I was inspired to increase my ambitions: Here's that version . When that produced a good result, I decided to push it all the way: We're back to prompts like "make it really good" here! Asking for a plot that "isn't too cliche" seemed to work too - it's a bit cliché, but still novel enough that I enjoyed following the story. Unlike Tree Appreciator, this took quite a bit of additional playtesting and prompting to get to a finished version. This was mainly due to gameplay problems - things like a character not being in the right place to complete a quest because a different story element had caused them to move to another location. Here's that final game . It has a full story that takes about 15 minutes to play through. There's even an experimental level editor if you want to drop in your own houses, furniture, and landscape features. Once it was all working (and I'd iterated through some gameplay bugs), I played it through from start to finish and found myself emotionally affected by the ending! I'm somewhat embarrassed by this, because everything in this game - the graphics, the plot, the characters, the music, the dialog - came from the model. My creative input was pretty much just "it's a fantasy village and there's a troll asleep in a cave". Here's the full shared Claude chat in which I built this game. I also fed that same initial sequence of prompts through ChatGPT GPT-6 Pro. Here's the transcript and the finished game for comparison. It looks great, but I don't think it plays nearly as well. This is by far my most successful project, which I wrote about last week . It's a Command & Conquer-style Real-Time Strategy game where two robot armies (or four as of Saturday ) build units, harvest scrap, and battle over territory. This is also the project that convinced me that Opus 5.5 knows what "fun" is. The first versions were built back in July using Claude Fable 5. It got me to a workable 2D Command & Conquer-style game, but it wasn't great to play. I prompted Opus 5.5 to "Make it a LOT more fun" and then later to "Port this game to three.js" and the game was transformed. There's a blow-by-blow account (prompts included) in my write-up . Today, Battle Drones has 2-4 player multiplayer (via a vibe coded WebSockets relay server), medals, replays, seven maps, a random map generator, and a set of "mutators" that add variants of the rules. It also lets different LLMs play against each other, using a mode where the game advances five seconds and then pauses to give different models time to interpret the new game state and line up their next set of commands. Here's a replay of Claude Haiku 5.5 vs. GPT-6 Luna : Battle Drones is a particularly good example of Opus 5.5's ability to create 3D models. This page lets you browse all of the models in the game . I released Battle Drones under the Apache 2.0 License last Tuesday. On Wednesday Gabriel Turpin released Panache ( screenshots here ), a fork of Battle Drones that reimagined the game for steampunk 1900s Belle Époque France, with new models and music and an animated intro sequence. Open source at work! I live in Half Moon Bay, California , home of the annual Half Moon Bay Art and Pumpkin Festival , which includes a giant pumpkin weigh-off competition. I decided to try building a game that wasn't just a cheap imitation of something that already existed, so I set out to create a game about farming pumpkins, growing giant pumpkins, and handling the rush of the October pumpkin season. I called it "Quarter Sun Cove". I'm still iterating on this project, but it's shaping up quite nicely. It's a cosy farming simulator where you spend the year tending to your giant pumpkin and planting out regular-sized pumpkins for sale in October, then sell pumpkins during pumpkin season and enter your giant pumpkin in the weigh-off. Every character in it is a (vegetarian) animal. The mayor of the town is a pelican. You can be a pelican, skunk, raccoon, possum, beaver, coyote, fox, owl, sea otter, or harbor seal. Those species all later show up (accompanied by their children) to buy pumpkins from you. It's absurdly cute. You can play the latest version here . I'm not convinced by the game mechanics yet - it's actually quite complicated: you have to decide when to plant pumpkins such that they will become ripe at the weekends in October with the most visitors. Here's the initial brainstorming session , which resulted in this spec file . Then I had Opus 5.5 Ultracode burn millions of tokens and nearly two days building it. I told Claude to "surprise and delight the user frequently" and the result is so many little details and easter eggs. There are mischievous raccoons, an elephant seal that runs the weigh-off, harbor seals that roll their pumpkins back into the ocean, a wandering goat, and superstitions about growing giant pumpkins that sometimes come true. This isn't my best game yet - it's not as fun to play as Battle Drones - but it represents the kind of game I want more of: weird, fun, uniquely personal - something that wouldn't have been built in the before-times. If you are offended by AI-generated art, AI-generated music, AI-generated writing, and AI-generated code, I have bad news for you: vibe coded games combine all of those at once . I respect those opinions, even though I don’t strongly hold them myself. The wider games community already has an aversion to AI-generated assets in games. This has been a growing issue over the past few years as tools like Midjourney have enabled developers to generate assets for their projects. This IGN story covering complaints about slop in Valve's Steam Next Fest is a good recent example. We now have games where everything - code, assets, dialog, and even the game design itself - can be outsourced to the models. And the results don't suck! Building a computer game used to be one of the most challenging projects in all of software development, combining a diverse range of skills and requiring intense focus and effort over many months or even years. And now here I am spitting out a playable multiplayer RTS by prompting on my phone! I expect that, as we've already seen with programming, this will result in a split. Some players will refuse to have anything to do with games that were built in this way. Others may embrace this as opening up game development to a much wider audience. I lean in that direction! I certainly won't be entering any of my vibe coded games in traditional game jams or competitions - I don't feel like I've earned that right. We'll likely see new avenues emerge for vibe game developers to compare their projects. The thing I find both exciting and shameful about this is that I have got interesting results from so little creative input . The projects I've described here are loosely ordered by how much effort I've put into them. Not a single project represents more than four hours of my work (plus many more hours of Claude Code churning away by itself). Now imagine what could be achieved by anyone who takes this seriously, invests significant creative time, applies better taste in game design, and then playtests and iterates on the result until it's as good as they can make it. I want to see games that wouldn't have existed without these new tools. Building games in this way is so much fun . It's the perfect application for vibe coding because it's so low stakes: how much damage can you cause with a bug in a personal vibe coded game project? (OK, you can do some damage... my attempt at audio-based multiplayer gave my wife Natalie a nasty headache !) All of my games so far have been HTML and JavaScript using static hosting (generally GitHub Pages or Cloudflare Pages). Modern browsers - including mobile browsers - are incredibly capable. Frontier models already know libraries like three.js and Phaser . I'm finding these mobile web games to be indistinguishable from the native experience, at least for the kinds of games I'm trying to build. I suggest starting with a prompt like this: This works on both chatgpt.com and claude.ai - you don't even need to fire up a full coding agent. As one last example, here's "Build a mobile-friendly three.js game where a mouse has to hide from a cat" by Claude Opus 5.5 Extra and by GPT-6 Extra High . Switch to Codex or Claude Code once your project passes the proof-of-concept phase. And if the game isn't fun enough, add this: You are only seeing the long-form articles from my blog. Subscribe to /atom/everything/ to get all of my posts, or take a look at my other subscription options . Tree Appreciator Battle Drones Pumpkin Farmer, aka Quarter Sun Cove Four times as insulting What happens if someone actually puts the work in? You should build a game! 3D modeling Music generation (see Scrimshaw Jukebox ) Game design (!)

0 views
codedge 2 weeks ago

No JavaScript needed

I have never been a fan of JavaScript. I don’t want it on my personal website. And I found ways to do things I usually would need JS for with static HTML and CSS. After a phishing attack on my friend’s computer I started to look closer at all the code I run without ever reading it. That attack was Node.js, not JavaScript in a browser - but its core trick, fetching code from a remote server and executing it on the spot, is exactly what every third-party tag on a website does. So I decided to ditch JavaScript entirely, where possible. I started to use NoScript and saw how awful most of the websites on the Internet are, if you disable JavaScript. Tons of external integrations (tracker?, analysis of user behaviour?) and completely broken sites where even the first load of content is not executed. I did not want to put users on my page in the same situation so I removed almost all JavaScript functionality from my site here and replaced it with static HTML and some CSS. Let’s have a little walk through what I normally would use JavaScript for and how I replaced it. JavaScript is often used to add features that HTML is not capable of. But then people forget to remove JavaScript when HTML finally added support for a certain feature, f. ex. lazy loading of images. Browsers have done this natively for years, yet many sites still ship a library for it. Every script that stays is code the visitor has to download, parse and execute - on every single page load. Another thing is tracking. Analytics, session recordings, heatmaps - all of this runs as JavaScript in the visitor’s browser. It collects data the visitor never agreed to share and it is often a reason why a site feels slow. Or third-party integrations. Embedded videos, social media buttons, chat widgets or comment sections load scripts from other servers. Each of them tells another company that someone visited my page, which is something I do not want. So either I can build it into my site directly, without relying on third-party JS integrations, controlling what goes in and out, or I skip it. I understand, there is probably not a real HTML-only (in combination with CSS) alternative to every functionality you want to have on your website. I found that for my use cases I do not need to rely on JavaScript - and hopefully will not in the future. Usually you would send your contact form with JavaScript. No page reload, nice success message once sent, or showing some errors underneath the input fields. My contact form uses staticform , my custom written form backend for static pages. I get HTML validation of fields on the frontend using HTML5 attributes 1 and proper field types. After submitting, the backend service validates again and redirects to a success or error page. No JS needed. A search on a static site usually means shipping a search index as a big JSON file and some JavaScript that crawls through it. Search engines have already indexed my page, so why not use them? My search page is a simple form that sends the query to DuckDuckGo and limits the results to my domain with a hidden field. I chose DuckDuckGo because it does not track searches, save IP addresses, or build user profiles. No JS needed. Using details element The classic hamburger menu on mobile does not need JavaScript. HTML has an element for exactly this use case built-in: . The is the clickable part, everything else is shown when it is open. The browser keeps track of the open state and sets the attribute on . With Tailwind’s variant I swap the menu icon for the close icon. and the selector remove the default triangle. On larger screens hides it completely and the normal navigation shows up. A newer option is the Popover API , available in all major browsers. The attribute turns any element into a popover, and a button with toggles it. It works a bit differently than the element with regard to placement and closing with the key. Still, a very good alternative to JavaScript. No JS needed. For a long time lazy loading images meant a library watching the scroll position and swapping a into the attribute. Browsers have supported this natively for some years. No JS needed. A bar on top of the screen that fills while you scroll through a post. This is usually an event listener on calculating the percentage and setting the width of an element. With scroll-driven animations CSS can do this on its own. Scroll-driven animations are not supported in every browser yet, currently Firefox is lacking support for this. Honestly this is not a big problem for me: browsers without support simply do not show the bar, and Chromium-based browsers still cover a big chunk of the browsers people use. No JS needed. With all these changes I am quite happy with the balance of interactivity on my site and features for reading content - and all this without JavaScript. There is one tiny script left: a visitor counter using GoatCounter , a privacy-respecting analytics solution. It does not use cookies or track individual visitors. It follows my understanding: I host the script on my own server, so no third-party code runs on my page - only the page view itself is sent to GoatCounter. You can find the link to the dashboard in the footer section. (Almost) no JS needed. Form Validation Essentials: https://www.ashleysheridan.co.uk/blog/Form+Validation+Essentials   ↩︎ loads the image only when it gets close to the viewport does not block rendering of the remaining page while decoding the image and let the browser reserve the space, so the layout does not jump around Form Validation Essentials: https://www.ashleysheridan.co.uk/blog/Form+Validation+Essentials   ↩︎

0 views
Den Odell 3 weeks ago

Design Systems Should Be Fast by Default

If a design system’s components are slow to interact with, so are any apps built with them. I timed large dropdowns and checkbox lists in some popular design systems, worked out how to make the slow ones faster, and wrote tests that fail when they’re too slow. Web apps are usually architected and built in layers. The browser is the foundation, often with a framework like React or Lit above that, followed by the company’s shared libraries and design system, and finally the product team’s own code is at the very top. The browser has one main thread for running JavaScript, responding to user events and drawing the screen , so the less work the lower layers do, the more of it is left for the app. If a design system’s equivalent of a dropdown takes a second to open and display its options, it’s not going to be any faster in the apps that use it, however well their teams write the rest of their code. If the design system team takes the time to make that faster, it unlocks better performance for all the apps built with the design system at once, and for everyone using them. I know that design system teams already think this way about accessibility. Using a well-built design system’s button component gives you the correct keyboard support and ARIA roles out of the box, and many design system teams rightfully check their components for accessibility thoroughly before each release. For some teams, though, performance doesn’t always get the same attention. Components usually get tested in isolation with just a few items, nothing intense enough for the cracks to show. They start to slow down once a real app gives them much more to do. The team building that app can feel the page is slow, but because that comes from the design system, they can’t easily fix it themselves. I feel that performance belongs on the design system team’s priority list, next to accessibility. That means testing each component with demanding but realistic amounts of data before it’s released, and making sure its performance doesn’t get quietly worse over time. “Performance belongs on the design system team’s priority list, next to accessibility.” I’m eternally curious, so I took it upon myself to conduct a bit of testing. I wanted to see how some of the most popular open-source design systems fared on performance. I deliberately chose ones built on different frameworks, as I was interested in whether certain frameworks would turn out to affect performance more than others. Here are the ten I picked, with the versions I tested in October 2026: I left out some popular design systems that weren’t actively being developed any more, for a fairer comparison. Also, React Spectrum and Spectrum Web Components obviously share the same design language, but they’re separate libraries with their own code so I wanted to see whether they’d perform the same. The first thing I did was to look through each of their codebases to see if they had any automated performance tests. Only Spectrum Web Components seemed to. It runs a benchmark for each of its components every time a pull request is created. Fluent also has a benchmark for each of its components, but I couldn’t see them running automatically anywhere. The others didn’t appear to test for performance on a component level at all. Ant Design, Material UI and Fluent do check their bundle size. That’s usually what design system teams measure when they consider performance, and it’s definitely important as it affects page load time, but it doesn’t relate to how quickly a component actually responds on the page. I then picked two fairly intensive tasks that real web apps do often and I timed each design system on those. The first was opening a country selector with all 249 countries from the ISO list , like the ones you get on checkout and sign-up forms. The second was selecting 100 checkboxes at once, just like clicking a “select all” checkbox above a list of 100 messages in a webmail app. I realize these two tasks aren’t an extensive review of performance across an entire design system, but they’re where components often get slow, so they’re a good place to start. Before we get to the results, I want to make clear that all of the design systems I tested are well built and are widely used, and they’re written by expert engineers who I respect. The point of this research isn’t to rank them or offer criticism, but to use them as examples to encourage us all to prioritize performance in our design systems. And for any problems I uncover, I’ll suggest a fix, the way I would in any manual code review. I ran these tests with production builds of each design system, using Chrome v155 on my M1 Pro MacBook Pro. A script clicked the country selector or checked all the checkboxes, then measured how long the browser’s main thread stayed busy afterwards, including any animation, and that’s the time shown in the tables. The script slowed the CPU down by 4x, the same as the throttling setting in the Performance panel of Chrome’s developer tools, which I always recommend when developing, because it’s closer to how real users’ devices perform. To avoid any spurious results, I ran each test three times and took the median values. I also measured the longest time the UI stopped responding during each task. That happens when the main thread is blocked, because the browser can’t update the screen or respond to user events, so the page appears to have locked up. Chrome only tells you about frames that take longer than 50ms to draw, so I’ve put “Under 50ms” in the tables wherever it didn’t report any. I’ve put the tests into a design-system-performance-tests repo on GitHub, by the way, in case you want to run them yourself. On to the results, and here’s how long each design system took to open the country selector, from fastest to slowest: The country selectors in Fluent and Carbon opened faster than any of the others. Ionic’s was by far the slowest, taking more than five times as long to open as the next slowest, React Spectrum. To see how the time to open changes as the list gets longer, I opened the country selectors in Ionic and Fluent again with just 50 options. Ionic’s took 203ms with 50 options, but over 1.2 seconds with all 249, and for most of that time the UI stopped responding. Fluent’s barely changed, going from 41ms to 61ms. Now, here’s how long each design system took to select all 100 checkboxes: Ant Design took six times as long as Material UI, even though both are built with React. Selecting the checkboxes didn’t stop the UI responding for any noticeable length of time in any of the design systems, which is encouraging. The longest it stopped responding for was 78ms, which is about five frames the browser skipped drawing at 60fps, far shorter than the slowest country selectors. Both sets of results showed that a design system’s performance didn’t depend on its framework by itself. Carbon, Web Awesome and Spectrum Web Components are all built with Lit, but the country selector in Spectrum Web Components took more than twice as long to open as the one in Carbon. And Ionic had the slowest country selector of all those I tested, but its checkboxes were faster than most of the others, so the same design system can be slow at one task and fairly quick at the other. I didn’t want to leave my testing there without trying to find out the reason for the differences between the results, so I did some profiling on the slowest ones. With the CPU still throttled by 4x, I opened the Performance panel, pressed its Record button, opened the country selector or selected all the checkboxes, and then stopped the recording. The Summary tab at the bottom of the panel shows how the main thread’s time gets split between Scripting, which is JavaScript execution, Rendering, which covers calculating styles and layout, and Painting, which is preparing what to draw on the screen. The “Bottom-Up” tab lists the JavaScript functions that ran, sorted by how long they took, and you can click on a function’s file name to open its source code in the Sources panel and see what it was executing. Going back to Ionic’s results from earlier, its country selector took more than six times as long to open with five times as many options. If each option took the same amount of time to add, it would take about five times as long, or a little less in practice, since showing the dropdown itself takes the same amount of time no matter how many options it has. That means each new option must take longer to add than the last one before it. Figure 1: The DevTools Performance panel after recording Ionic’s country selector opening with 249 options, with the Bottom-Up tab open and the slowest functions at the top. In the Bottom-Up tab for Ionic’s country selector, shown in Figure 1, most of the top rows were functions with minified names, all from the same file. That file also had its own version of , a method the browser normally provides, and running that version took up about half of the time the country selector needed to open. Clicking into those functions, I could see the file contained Stencil’s framework runtime. The button at the bottom of the Sources panel formats minified code so it’s easier to read, and when I compared it with Stencil’s source code on GitHub, I could see that these functions were part of Stencil’s handling of slots. A slot is a placeholder inside a web component that marks where the elements you put inside it are shown, such as the options inside a dropdown. Other design systems built with Stencil might have the same problem. In Ionic’s country selector, each option is a radio button, and they’re all inside a radio group, , which makes sure only one of them can be chosen at a time. Slots are normally handled by the browser, through shadow DOM, which is the feature that gives a web component its own private set of elements, separate from the rest of the page. doesn’t use shadow DOM, though, so Stencil handles the slots instead. It replaces the radio group’s and methods with its own versions that work out where each new option should go. To do that, it checks all the options already in the radio group to find the right slot, then checks them again to work out where the new one should go. Once the new option has been added, Stencil goes through all the options a third time to find out whether the slot’s fallback content should be shown. Fallback content is what a slot displays when it’s empty. Adding the 249th option means checking the 248 options before it three times, while adding the 10th only means checking the 9 before it, which is why each new option takes longer to add than the last one. The setting that replaces is called , and Ionic enables it through another setting, , which turns on all of Stencil’s fixes for slots in components that don’t use shadow DOM, including that one. So the delay comes from that setting together with a radio group that doesn’t use shadow DOM, rather than from Stencil being slow in general. Both settings are by default today, but Stencil’s documentation say they’re meant to become by default in the upcoming v5 release. If that ships as it is, any component that uses slots without shadow DOM will slow down the same way Ionic’s dropdown does, because Stencil will check all of its existing children each time a new one is added. Ionic could fix its dropdown by making use shadow DOM, so the browser handles the slots instead of Stencil, and the browser’s normal function would then be used. That fixes Ionic’s dropdown for all the apps that use it, though it would change how apps can style the radio group, so it would probably need to wait for a major release to do so. Or Stencil could fix the problem by only checking the fallback content of the slot that changed, and skipping that check when the slot already had options in it, because its fallback content would already be hidden. To find out how much difference that would make, I removed the third check from a copy of Stencil and added 2,000 elements, one at a time, to a simple test component. Adding them was about seven times faster without the check. Fixing it directly in Stencil would also fix the same problem in any Stencil-based design system that uses slots without shadow DOM. I’ve raised this with both the Ionic team and the Stencil team . I ran in the Console before and after opening Material UI’s country selector, and the count went up by about 250 elements, one for each option, as soon as its dropdown opened. I ran the same check on Ant Design’s country selector, and the count only went up by about 40. Ant Design’s country selector renders just the options that fit in its dropdown, and renders more as you scroll, which is a form of virtualization. That’s why it opened noticeably faster than the one in Material UI. Virtualization works for long menus and tables too, but it needs care with keyboard navigation and screen readers, because only the options or rows that fit on screen are actually in the DOM. Ant Design’s dropdown is a good example to learn from here. As well as the options you can see, it keeps a hidden copy of the highlighted option in the DOM, so screen readers can still announce it. In the Summary tab, I noticed that Rendering made up about half of the time UI5’s country selector took to open, and Scripting made up much less. So the delay was mostly coming from the browser working out styles and layout, not from executing UI5’s JavaScript functions. In the Elements panel, all 249 options are already in the DOM before the dropdown opens, inside a hidden popover. The browser doesn’t work out styles for elements that are hidden, so when the popover opens, the browser has to style all of them at once. That’s about 1,500 elements, because each of the 249 options has its own shadow DOM with more elements inside. Virtualizing the list, the way Ant Design does, would give the browser far fewer elements to style. React Spectrum’s country selector uses virtualization too, but it was still the second slowest to open, after Ionic’s. I opened it with half as many options, and it took about the same amount of time, so the length of the list wasn’t what made it slow. I profiled it, and near the top of the Bottom-Up tab was a browser function, , called from React Aria, the library React Spectrum is built on. In React Aria’s source code , I found that every time the country selector opens, React Aria goes through the visible options one by one. For each one, it checks that the option is visible, clears its height, and then reads its size, and the browser has to work out the layout of the page again for each of those checks. This is known as layout thrashing. All of that happens straight after the user clicks the country selector, and the UI stops responding until it’s finished. React Aria could clear the heights of all the options first, and then check and measure them all, so the browser only has to work out the layout once instead of again for every option. I’ve raised an issue with the React Aria team about this. I profiled Ant Design’s checkboxes as all 100 were selected, and executing JavaScript made up less than a third of the time it took to select them all. The rest was the browser calculating styles and drawing each checkbox’s animation, 100 times over. I turned the checkboxes’ animations off on the test page, with a CSS rule that sets their transitions and animations to , and selecting all the checkboxes then took less than a third as long. Almost all of the style and drawing work went away, and so did some of the JavaScript, which was tied to the animations. The animation helps when someone checks one box, but users don’t need to watch 100 checkboxes animate at the same time. Ant Design could fix this by only animating a checkbox when someone selects it directly, or the code behind a “select all” checkbox could turn the animations off before checking all the other checkboxes. “Users don’t need to watch 100 checkboxes animate at the same time.” None of this means a design system has to give up its animations, because they can be changed to be less demanding for the main thread. The Elements panel shows that Ant Design’s checkbox styles fade the checkbox’s background and border colors, which the browser has to repaint on the main thread for every frame. Fading the opacity of a filled layer gives the same effect, and the browser can run that on the compositor thread instead. That’s a separate thread that puts together the parts of the page the main thread has already drawn, so it can fade them by itself and keep the animation running even while the main thread is busy. I found these problems by profiling, but each one could have made a performance test fail before the component was released. Most component tests render one copy of the component with a few props, which shows it works, but not how fast it is with 249 options in a country selector or 100 checkboxes being checked at once. In a performance test, you set the component up the way a real app would use it, and then time how long the page takes to respond when you interact with it. Listing 1, below, introduces Playwright performance tests for the country selector, using a fake design system I made up called Nettle. The repo runs the same tests on each of the ten design systems I tested, along with a test that checks all 100 checkboxes at once. The test page renders the country selector with the number of countries set in its URL, such as . In each test, Playwright clicks the country selector to open it and measures how long the browser’s main thread stays busy afterwards, along with the longest time the UI stopped responding. Listing 1: Performance tests for Nettle’s country selector. The function in Listing 1 returns Chrome’s metric, which is a running total of how long the main thread has been busy. If you subtract the total before the click from the total after it, you get the time for everything that happened as a result, including JavaScript execution, rendering and painting to the screen. I ran both tests with the CPU slowed down four times, the same as for the tables above. In my testing, Ionic’s country selector was the only one to go over the first test’s 300ms limit with all 249 options. One long pause that locks up the UI feels worse to a user than several short ones, even when they add up to the same total time. The country selectors in Spectrum Web Components and UI5, for example, took almost the same total time to open, but the one in Spectrum Web Components opened in several smaller steps, so the page only locked up briefly each time. UI5’s one had to style all of its options at once, so the page locked up for longer. That’s why the first test also uses the Long Animation Frames (LoAF) API , which reports any frame that takes over 50ms to draw, so the test can fail if one of them takes 100ms or more. With all 249 options, the country selectors in Ionic, Material UI, React Spectrum and UI5 failed that check, and Ionic’s failed it even with just 50 options. Each limit in these tests is a performance budget , which is the most time something is allowed to take before the test fails. I picked 100ms as the budget for how long the UI can stop responding, because that’s roughly where a response stops feeling instantaneous. In the first test, I gave the total time a higher budget of 300ms, because the test waits for the dropdown to finish animating open, so the total also includes drawing each frame of that animation. You can set your own budgets by running the tests on your components now and setting each one a little above the result, so the tests fail if a later change makes a component slower. The second test in Listing 1 opens the country selector with 250 options, rounded up from 249 so it halves evenly, and then with half as many, the same kind of comparison I made with Ionic’s results earlier. The full list should take no more than about twice as long to open as the half list, so the test fails if it takes much longer than that, with a little room to allow for the times varying from run to run. Every country selector except Ionic’s passed easily, taking well under twice as long with the full list, while Ionic’s took nearly three times as long and failed. If I could only choose one test to run, it would be this one, because it fails when each option takes longer to add than the last one, and you don’t need to change its budget for machines with different specs. After I’d written these tests, I found that Spectrum Web Components already has an automated test for a country selector just like mine, with all 249 countries. But that test only times how long the closed dropdown takes to render on the page, while this one times how long it takes to open when someone clicks it. The same ideas work for other components too. You can adapt the country selector tests for anything that shows a long list, like a menu or a table, and the checkbox test for anything that appears many times on a page, like icons or buttons. If you run these tests automatically on every pull request, with something like GitHub Actions, you’ll know straight away when a change affects a component’s performance. To try the tests on your own design system, you can copy one of the folders in the repo and change it to use your components. The README explains how, and the repo also has a GitHub Actions workflow ready to use. Repository: denodell/design-system-performance-tests — The country selector and checkbox tests from this post, with a folder for each of the design systems I tested. Each one times how long the main thread stays busy and how long the UI stops responding, with the CPU slowed down by 4x. Apart from testing, I think the most useful thing you can do is make the fast behavior the default. A dropdown can switch to virtualization once its list gets long enough to go over its performance budget, and a checkbox might only animate when someone selects it directly, as I suggested for Ant Design. App teams then get the fast version without having to know the problem ever existed. “Make the fast behavior the default.” You can also write in your design system’s documentation how many items each component has been tested with, such as “the dropdown is tested with up to 500 options, and above that an autocomplete is a better fit”. To work out how many options to specify there, you can keep running the tests with more options until the dropdown goes over its performance budget. Once that limit is documented, app teams know how far they can push a component before it gets slow, and you know how many items your tests need to cover. Pages in real apps that use lots of your components are the best indicator of what to fix next, because they show how your components are really used. If you ask app teams now and then to record a profile in the DevTools Performance panel while they use those pages, and send it to you, you can see which of your components might be impacting performance. In React’s development builds, those profiles include a Components track , which is a row in the Performance panel’s timeline showing how long each component took to render. Profiling builds only show it for the parts of the app wrapped in React’s component. Web components don’t get a track like that, but I’ll cover a solution to that in a follow-up post. Each time you release a performance fix, your release notes can give the before and after measurements, such as “the dropdown now opens in 150ms with 500 options, down from 300ms”. App teams can then see exactly what got faster and check the difference in their own apps, the same way a line like “screen readers now announce the selected option” tells them what’s improved for accessibility. A design system is a foundation for the apps built with it, just like the browser is. Browser makers measure performance before every release, and it’s worth doing the same with your design system. This is the idea behind Fast by Default : building performance in from the start, instead of fixing it after users complain. My new book, Fast by Default: Practical Performance Engineering , takes this approach further, for backend and mobile code as well as the web, and explains more about how to set performance budgets and check them on every pull request. It’s in early access from Manning now. Mantine 9.7.1, built with React Ant Design 6.6.5, built with React Material UI 9.5.0, built with React React Spectrum 3.47.6, built with React Carbon 2.65.0, web components built with Lit Fluent 3.1.3, web components built with FAST, Microsoft’s web component library Web Awesome 3.14.0, web components built with Lit UI5 2.27.2, web components built with SAP’s own in-house framework Spectrum Web Components 1.12.4, web components built with Lit Ionic 9.0.7, web components built with Stencil

0 views
Ahmad Alfy 3 weeks ago

A select should tell you something

Heads up: your browser doesn’t support customizable selects yet, so the “after” demos below look like ordinary selects. That’s also exactly what your visitors would see in this browser. To see the difference, open this page in Chrome or Edge. There are multiple articles about and how you can use it. We finally can style a select. The bigger change is what an option can hold. Until now, an option was one line of plain text, so everything a person needed to decide had to fit in a label or be left out. Now an option can carry the thing people actually decide with: a preview, a number, a job title, a warning. They stop reading and working things out, and start recognising. Below are five selects, each shown before and after. The before is what most forms do today. The after is the same , with the same keyboard behaviour and the same form value. Only what it shows has changed. If you want the mechanics, the Chrome team’s announcement and MDN’s guide cover them well. A font picker usually lists names. To choose well, you either already know what Fraunces looks like, or you pick it, look at the result, and come back to try the next one. When each option is set in its own typeface, the option is the preview. You judge the shape, not the name. This pattern is not new. We already have in document editors (like Google Docs) and in design tools (like Figma and Photoshop). It just became available for us and all we need is one inline style per option, , and the closed control keeps the typeface after you choose. We are also able to show the category of each font, like Serif, Sans, Mono, Display, or Handwriting. Time zone pickers tend to look like “(GMT+09:00) Tokyo”. The offset is accurate and almost never what you want. What you want is the time there, so you add the offset to your own time in your head, and maybe get it wrong around midnight. Show the current time next to each city, plus whether it’s day or night, and the question answers itself before you choose. This is the only demo that needs JavaScript, because the times come from . Delivery options are usually a group of radio buttons, each with its details written out as a sentence. To be fair, radio buttons have a real strength. Every option is visible without a click, and for two or three short choices they’re the right pattern. But once each option carries a few facts, the facts end up in prose. Comparing means reading every sentence and holding the numbers in your head. A select with the facts in aligned columns turns that into a glance down a column, in the space of a single field. The columns are a grid on each option: At a company of about two hundred people, we had two colleagues with the same name, in different departments. Whenever I had to pick one of them, I went by their job title. Photos help less than you’d think, because people often don’t know what a colleague looks like, especially one in another department. A text-only select gives you two identical options and a guess. Put the title and department under each name and they become two different answers. The closed control keeps the title too, so anyone reviewing the form can see who you picked. Some options come with consequences. In a plain select, you find out afterwards. Mark those options in the list and you know while you’re choosing. needs approval People Legal , needs approval Security , needs approval Sales Support Before, you find out a team needs approval after you’ve shared. After, you know while you’re choosing. The badge appears only on the options that require special attention, and nowhere else. Every “after” in this post is a plain . Keyboard handling, type-to-jump, form submission, , , validation and the accessible role all stay with the browser, and the control itself needs no JavaScript. The bigger trade-off is on phones. A native select opens the operating system’s own picker. It shows a scrolling wheel on iOS, a sheet on Android. Those are familiar, sized for thumbs, and tuned to each platform’s accessibility features. A customizable select doesn’t use them; it draws its own list on the page instead. You don’t have to pick one behaviour for everyone. Opt in only where there’s a mouse or trackpad, and touch devices keep their native picker: Phone users then see each option’s text without the extras, which is one more reason the text has to stand on its own. The demos in this post opt in everywhere, so you can try them on any device. Customizable select is a textbook progressive enhancement. A browser that doesn’t support it doesn’t break. It shows a regular native select, keeps only the text of each option, and submits the same value. Nobody gets a worse form than they have today. If you’re reading this in Firefox at the time of writing, the “after” demos above are exactly what your visitors would see. That leaves one requirement, and it’s good practice anyway. The text of every option has to make sense on its own. “Ahmed Mostafa, Accountant · Finance”, not just a name. “Express, Tomorrow, $8.50”, not three loose fragments. In the demos, small separator spans that are hidden in the customized version make the plain version read like a sentence. No polyfill needed. So there’s no reason to wait. Find the select in your product where people hesitate the most, ask what they’re really trying to find out, and put that answer inside the option. Leave everything else out.

0 views
Unsung 3 weeks ago

Apple’s iPod recreation

Just a week ago , I bemoaned the lack of any good iPod click wheel explainers, and today the news broke about Apple Music hiding a functioning iPod on their 404 page . I am usually not a fan of easter eggs – most of them are poorly made – but this might be the best iPod recreation I’ve seen, and it’s an interesting thing to study: = 3x)" srcset="https://unsung.aresluna.org/_media/apples-ipod-recreation/1-framed.1600w.avif" type="image/avif"> Most importantly, it works well on mobile, too – well, some of the page chrome and ads feel a bit the way, but it’s not a big deal (and you can hide them using the Hide Distracting Items feature in Safari) – so you can pretend you’re holding an iPod in your hand. Worth spending a bit of time with it, especially if you have never used an iPod in your life: Kudos to whomever put this together. This is how you do easter eggs. (I tagged this as emulation , even though this is a grounds-up recreation in HTML, CSS, and JavaScript.) I think it generally covers all the modes etc. (with small exceptions) the typography looks accurate, it has the little “haptic” beeps, it has proper acceleration and the scrollbar, it has a little music library with various playlists, I have only noticed a few small bugs.

0 views
Michael Lynch 3 weeks ago

Refactoring English: Month 22

Hi, I’m Michael. I’m a software developer and founder of small, indie tech businesses. I’m currently working on a book called Refactoring English: Effective Writing for Software Developers . Every month, I publish a retrospective like this one to share how things are going with my book and my professional life overall. At the start of each month, I declare what I’d like to accomplish. Here’s how I did against those goals: This is finally complete! I got caught in a loop because there’s a one-week turnaround between ordering a print and getting to see what a physical copy looks like. So, I’d order a print and make some improvements while I was waiting. By the time I received the test print, I wanted to include the last week of improvements, so I had to order another test print and wait another week. And while I was waiting, I made more improvements… Finally, I had to decide that a version was good enough and that it was ready for customers, but I’m continuing to make small tweaks on a rolling release basis. I ended up spending a lot more time than I expected touching up the print version, so I had less time to pitch to podcasts. Both posts reached the front page of Hacker News, Lobsters, and /r/programming. I was happy with these results, especially because one of my selling points of the book is that writing helps customers find you. It was nice to prove that with blog posts that led readers to purchase the book. September was the second-best month of visitors for the book, though I didn’t directly cause it. Most visitors arrived because a reader submitted my “How to Write an Effective Software Design Document” post to both /r/programming and Hacker News, and the post took off in both places. The post’s success was surprising because the same article had been submitted to Hacker News nine times before and never took off. Tenth time’s the charm, as they say. And I’d submitted the post to /r/programming a few months ago, and it did take off, but I guess everyone forgot or was happy to read it again two months later . I normally cover the previous month in these retros, which would be September, but since I’m late and the October launch is fresh in my mind, I’ll cover it here. I officially launched my book! Launch week was October 4th to 11th. I offered a print version for the first time and offered a limited-time 30% discount on both the print and digital versions. Here were my launch week promotional activities, in decreasing order of impact on sales: Unique visitors to book site during launch week Here are some high-level metrics comparing launch week sales to the prior week for reference: I initially planned not to put much effort into the print version. The PDF version already looked pretty good, and customers have been buying it for over a year with no complaints about the design, so I wasn’t about to become a typography wonk over a print version. Then, a reader named Alexey Zubkov reached out to me with a few suggestions for my book and offered to help me with the typography. Once Alexey pointed out the issues, they felt like huge, glaring errors, even though I’d been staring at this book for years and never noticed them. One of my blind spots was that I wasn’t using my font’s pair-specific kerning. Without pair-specific kerning, Asciidoctor gives each letter a fixed slot of horizontal space regardless of which letter follows it. When it honors pair-specific kerning, Asciidoctor adjusts the horizontal spacing for certain combinations like “Yo”: Without kerning (top) vs. with kerning (bottom) Notice that with pair-specific kerning, part of the “o” appears directly under the “Y.” The two letters can share that space because the font designer knows the combination works, whereas if it was lowercase “yo,” the letters would collide. And that’s just one change! I made a little slideshow to show how a single page evolved over about 30 different typography improvements, and this still excludes many that had no impact on the example page: Add GOOD/BAD prefix and icons to examples Enable JavaScript to browse the remaining revisions. I’m selling the print copies of the book through Lulu, using a feature they recently added called Direct Buy Button. The basic idea is that you upload your book as a PDF, and they give you a link where people can buy a print version. Lulu offers print on demand, so they print a new copy for the customer and ship it directly to them. Lulu Direct Buy Button is significantly simpler than Shopify or WooCommerce, where you have to manage a whole ecommerce platform. Its closest parallel is Amazon Kindle Direct Publishing, though without the pain of dealing with the giant Amazon machine. My overall experience with Lulu has been okay. They deliver on the core promise, which is that they make it easy to sell a book through a link, but there are still a lot of rough edges. I wrote my book in Asciidoc because it was the only tool I could find that outputs to PDF, EPUB, and HTML. By the end, I got so tired of Asciidoc syntax that I spent a day writing (largely with AI) a Markdown to Asciidoc compiler so that I could stop writing in Asciidoc. Here’s an example of the difference. My book contains a lot of example callouts like this: Before, to render a callout like the above, I had to write gross Asciidoc that looked like this: The syntax above is especially annoying because most of that is boilerplate that appears in every example, but Asciidoc doesn’t support templates, so I have to repeat all the boilerplate every time. I wrote my own Markdown compiler that supports Hugo-style templates. Now, when I want to generate a bad example callout, I write this simpler and more readable shortcode: I also wrote an Asciidoctor plugin to improve the callouts to look like this instead of what I was limited to with native Asciidoctor: The example callouts were where the Markdown syntax was most obviously cleaner, but it also allowed me to stop thinking about Asciidoc’s confusing and inconsistent rules like when a straight quote becomes a curly quote . I’ve set it up so that I just write straight quotes everywhere, and my compiler worries about translating them to the right Asciidoc syntax for curly quotes. I’ve been meaning to try out Atuin for about a year. It’s a tool that collects your full terminal history and can sync it across machines. Every time I’m struggling to remember a command I typed a few days ago and I’ve lost it to bash’s confusing history management rules, I think, “I should really look into Atuin…” And then I keep putting it off. I finally set aside a few hours to set up Atuin, and it took me less than five minutes to install. I use NixOS, so a basic configuration just looked like this: The biggest decision I had to make was whether to let Atuin take over my up arrow. I didn’t realize Atuin took over the up arrow by default, so when it first started happening, I found it jarring. I couldn’t decide if Atuin’s up-arrow takeover was a worse workflow or if I just needed to adjust, but after about a week of trying to use it, I disabled Atuin from hijacking the up arrow. Now, the way I search my shell history is: I’m enjoying Atuin. It does exactly what it says. If I know that I’ve ever typed a command on the terminal, Atuin lets me find it quickly. My final Atuin config looks like this: Code a simple bug fix: 30 minutes. Get it code reviewed by the peer next to you: 5 hours… AI’s direct impact on this problem is minimal. Okay, so Claude can code it in 3 minutes instead of 30? That’s super, Claude, great work. Now you either get to spend 27 minutes reviewing the code yourself in a back-and-forth loop with the AI (this is actually kinda fun); or you save 27 minutes and submit unverified code to the code reviewer, who will still take 5 hours like before, but who will now be mad that you’re making them read the slop that you were too lazy to read yourself. Another participant said he was confused by two slides that seemed to contradict each other. I thanked him for showing the group how quickly men become hostile when asked to hold complexity. He said he wasn’t hostile. I asked everyone to notice that he had now interrupted a woman twice. He put his hand down. I said withdrawal is also a form of domination. He put it up again. We took an unscheduled break so I could regulate after what he had put me through. I launched my book and made lots of typography improvements to it. I’ve had mixed experiences with Lulu Direct Buy Button. I created a Markdown to Asciidoc compiler so I can stop writing in Asciidoc. Result : Launched the book (a week late) Result : Pitched to just one podcast Result : Published “Anti-Patterns in Software Blogging” and “Why are Agent Harnesses so Dumb?” during my book’s launch week Published “Anti-Patterns in Software Blogging” Went to #1 on Lobsters and /r/programming and peaked at #8 on Hacker News Published “Why are Agent Harnesses so Dumb?” It got a decent response on Hacker News and Lobsters Submitted an announcement to Hacker News Never made it to the front page Announced launch to my book email list Announced launch to my personal blog email list Fees are transparent and clear. Print quality is good. Lulu handles fulfillment, so the book goes straight from the printer to the customer. It’s easy to get up and running. The integration with Stripe Connect means authors don’t pay double fees for the sales platform and the payment platform. Customers haven’t reported any issues checking out. It’s print-on-demand, so you can order in any quantity, down to a single book. It’s easy to update the contents of the book, and the changes go live instantly for all future orders. There’s no programmatic way to see order information. Direct Buy Button doesn’t support webhooks or any kind of order query API. I reached out to support to see if I was missing something, and they said that the dev team intentionally designed Lulu Direct Buy Button as “a closed ecosystem” but did not elaborate on why anyone would want that. This is the biggest headache because it means I can’t programmatically react to purchases, like giving the customer access to the PDF version or the web version. Confusingly, there is an API for order status, but it only works for orders created through the API, so I’d have to reimplement all the server-side logic of Buy Button myself. There’s an undocumented GraphQL API for fetching the orders as a CSV, but Lulu invalidates sessions daily and makes every login go through a CAPTCHA, so it would be a pain to try to build automation on top of that API. Each product can have exactly one price. I wanted to offer a discounted price for customers who pre-ordered the ebook, but there’s no way to offer different prices or discount codes. As a workaround, I created a second, identical book with a lower price, but now any time I update the content of my book, I have to apply the change to two different products. There’s no built-in support for ordering a test print before releasing a version to customers. If I make a change to the book that could affect the print, I want to do a test print first. I can’t mark a draft as “not ready for customers.” As soon as I update a draft, that’s the draft that ships to customers. I worked around this by creating a third copy of the book that I use for test prints. Lulu’s CSV export omits important information. You can export order information as a CSV, but you have to do that manually. Bizarrely, the order export has no information about when the orders occurred. There’s no date or timestamp column. The CSV export also hides customer information like name and email unless the customer opted in to marketing. And I appreciate Lulu fighting spam, but it’s annoying that Lulu views these as Lulu customers rather than my customers. And Lulu exposes the customers’ information anyway in the dashboard, but you just can’t dump it in aggregate. You need to provide a return address even if you don’t accept returns. I ended up having to register a virtual mailbox, which is a whole other pain in the butt. I wish Lulu just offered a “recycle the book if you don’t want it” refund option. The current setup means customers have to ship a book to me across the country, but I’m just going to recycle it because I can’t do anything with a used copy of my book. Lulu makes it hard for authors to understand their earnings. They show “Revenue” in a lot of places, but my earnings dashboard said I’d earned $0 even after $2k in sales. I was able to calculate my earnings manually by downloading all my orders as a spreadsheet. Customer support is pretty bad. It took several days to respond to my questions, and the answers were unsatisfying. : Triggers , bash’s built-in search for the current session : Triggers Atuin to search over all commands across all sessions. Cryptic Comments on an NPR Spotify Show This is a recent episode of This American Life about a producer who found strange comments on an interview with author Elizabeth Gilbert. I read the transcript and then listened to the audio, but I wish I’d listened to the audio first because it was more fun that way. Spoiler: it’s the real-life manifestation of The Onion’s 2014-but-still-timely video: “Teens Migrating From Facebook To Comments Section Of Slow-Motion Deer Video.” Every layer of review makes you 10x slower This post is the best articulation I’ve found about the cognitive dissonance of the speedup I expect from AI vs. how much I experience in practice: Code a simple bug fix: 30 minutes. Get it code reviewed by the peer next to you: 5 hours… AI’s direct impact on this problem is minimal. Okay, so Claude can code it in 3 minutes instead of 30? That’s super, Claude, great work. Now you either get to spend 27 minutes reviewing the code yourself in a back-and-forth loop with the AI (this is actually kinda fun); or you save 27 minutes and submit unverified code to the code reviewer, who will still take 5 hours like before, but who will now be mad that you’re making them read the slop that you were too lazy to read yourself. A Marginal-Utility Case for Stealing My Grandmother’s Pain Pills This is a parody of LessWrong (popular rationalist site) that I thought was pretty funny. I saw JeffTK describe it as AI-written and thought it was too funny to be AI-generated. The only thing that makes me think it’s AI-written is the number of articles (68) that seem to have appeared out of nowhere. It also links to a Substack parody called Smugstack featuring gems like “I’m an Anti-Racist Educator. It’s Not My Job to Educate You” : Another participant said he was confused by two slides that seemed to contradict each other. I thanked him for showing the group how quickly men become hostile when asked to hold complexity. He said he wasn’t hostile. I asked everyone to notice that he had now interrupted a woman twice. He put his hand down. I said withdrawal is also a form of domination. He put it up again. We took an unscheduled break so I could regulate after what he had put me through. I don’t know what to make of the site because all the articles are like two or three orders of magnitude funnier than anything I’ve seen AI produce, which suggests human writing, but I can’t imagine this author was privately writing stuff this good for this long, and nobody noticed until now. My best guess is that the author has a good sense of humor and is injecting the core jokes but is using AI to flesh out the specifics. Officially launched my book. Improved a lot of design aspects of the book website, especially the purchase flow. Published “Anti-Patterns in Software Blogging” Published “Why are Agent Harnesses so Dumb?” Publishing print books is both harder and easier than I expected. It’s easier in that print on demand eliminates a lot of the hassle I anticipated of having to carry inventory and manage logistics. It’s harder in that selling a print copy means integrating with another sales platform, and the options are either complex platforms with lots of integration options or simple platforms with no integration options. Finish remaining typography improvements for the book. Publish one new blog post.

0 views
Simon Willison 3 weeks ago

Battle Drones - a vibe coded RTS with audio-based multiplayer

My latest vibe coded game experiment is a Command & Conquer style RTS (Real Time Strategy) game called Battle Drones ( play it here ). Unlike my previous experiments , this one is actually fun to play . I'm somewhat embarrassed to admit that I got there by telling Claude to "Make it a LOT more fun". It also supports multiplayer between nearby devices using audio to synchronize game state! Here's what I've built so far, and some of the things I learned along the way. My initial goal was to build an RTS game I could play on my phone, in the style of Command & Conquer . I have fond memories of the 1995 original (I liked Red Alert too) and wanted to recapture a little bit of the magic. After 12 major iterations (and 321 commits by coding agents, mainly Claude Code) I now have a browser-based game that works on mobile and desktop, has multiple play modes, several maps (including a random map generator) and even supports multiplayer for two devices within microphone range of each other. Here's a video demo of Battle Drones running in a desktop browser: Features so far include: Battle Drones is heavily vibe coded - I've reviewed almost none of the code, and it's built in a language (TypeScript) that I've hardly used myself. I've playtested it quite a bit though, and it's been through a large number of iterations since I started the project. Here's a rough history of the project so far, including key prompts and links to transcripts. I started out with Claude Fable 5 back in July: Here's a shared transcript . I'd given Claude Code for Web an environment variable with an OpenAI API key and told it to use the OpenAI Image Generation API for assets, which got me some basic sprites. You can try v1 here - it looked like this: It's recognizable as an RTS, has building mechanics and the ability to select and direct units, and a basic AI to play against. This first version was barely a proof of concept, and it wasn't any fun to play. Claude used the Phaser 2D game framework for these early versions. I didn't even realize this until several iterations later! The second version ( try v2 here ) added sprites for all of the vehicles and the "AI vs. AI" mode, so I could watch the game playing without having to directly control it myself. Claude proved reasonably competent at prompting OpenAI's image models to generate sprites. You can browse the v2 sprites in the public/assets/sprites folder. It still wasn't much fun, and the graphics were boring. It was now October, and I had upgraded to Claude Opus 5.5. I told it: This resulted in five new maps with generated background tiles in a variety of styles, visible here . Opus also regenerated the sprites, making them much more visually appealing. You can try v3 here - it looks like this: This is starting to feel like a real game! It still wasn't very fun to play though - I found myself getting bored pretty quickly. So far my Battle Drones experiment was confirming my previous belief that coding agents can build a thing that looks like a game but can't actually make something that's genuinely compelling to play. I shared this theory with someone over dinner, and then thought to myself that I should give the models a proper chance to prove me wrong. I prompted Opus 5.5 on my phone: This time I was running in Ultracode mode , where Claude Code (in this case Claude Code for Web) runs "dynamic workflows", described in their docs as: A dynamic workflow is a JavaScript script that orchestrates many subagents at once. This kicked off many hours of work. I started it in the evening and didn't get a playable result back until late into the next morning. But the results were spectacular. You can try v4 here - it looks like this: I had Claude write its own release notes - here are the highlights: Every skirmish and Daily Op now opens with a choice, gives the side that's losing a way back, and pulls the armies into the middle of the map. There are also two new ways to play. Fights run longer and swing more. In 1,200 AI-vs-AI test matches on Normal, games still undecided after 25 minutes fell from 14% to 0.9%. The share of wins by a side that had been 800+ scrap behind rose from 24% to 46%. Part of the reason Claude took so long was that it ran over a thousand simulated playtest sessions, and used the results to rebalance the existing units, add new ones, and introduce new features. After the success of Ultracode at "Make it a LOT more fun", I decided to be more ambitious: That was another overnight run. I woke up to this v5 version : The new 3D models were entirely constructed by Claude in TypeScript code. v6 ( play v6 here ) added some more visual polish. v7 ( play v7 ) added robot infantry (troopers, rocket squads, snipers) and a "Condor" troop carrying aircraft. I was beginning to feel guilty at how little actual design input I had into the game - it really had been a case of me saying "make it more fun" and "add visual polish" for the past few releases. I'd noticed that the AI didn't use the new infantry and troop carrying aircraft from v7 very often - there wasn't a great strategic reason to use them. It would be neat if we had a new map with a new game mechanic that actively encouraged players to load up Condors with infantry robots and send them out into the map. This resulted in my longest prompt yet: The result was the tropical Archipelago map, with seven island uplinks that players can only capture by flying out infantry in a Condor. It's definitely the most fun map to play, once you've got the hang of the basic game mechanics from the simpler maps. The v9 edition made that map a little more interesting - it now looks like this: I decided to add giant robot mechs to the game - think Jaegers from Pacific Rim , or Titans from Warhammer 40,000. Here are some of the prompts I used to brainstorm with Claude: The end result is really cool . Goliaths can be constructed using a Gantry - a building that can only be created after first building a Fab, Bay, Airpad, and Tech Lab. You can see the Goliath under construction, and it then walks out from the Gantry and can march around the map. Goliaths can "anchor", which digs them into the ground. In their anchored state they can act as a new HQ, constructing infantry units and additional buildings in a new area. Two Condor aircraft can hook onto a Goliath, at which point it can be flown around the map! The game now ends when you destroy the enemy's HQ building and any Goliaths they might have built. There are also a couple of mutators relating to Goliaths: The other v10 feature is agent battles . In musing about how multiplayer could work I had an idea: what if different LLMs could fight it out in the game? Opus 5.5 went to work on this, producing this AGENT-BATTLES.md proposal and then implementing and testing it. The feature also includes the ability to record and replay these battles - here's a replay of Claude Haiku 5.5 vs. GPT-6 Luna , and here's that same battle in a separate debug tool that shows the underlying prompt responses. The prompt that drives agent battles can be seen here . There are a few more replays like this linked in the README . I hope to turn this into a full league table at some point in the future. This version exists purely because I glanced at my Claude Usage page one day and saw that I'd only used 75% of my weekly allowance and it was resetting in 45 minutes. I decided to see if I could get an extra Battle Drones feature from my remaining tokens, and picked "random map" as the target: Here's the transcript , and an image Claude generated to show me its work: I only just got this working, so I've not had much time to actively test it yet. The latest Battle Drones now supports multiplayer via two devices sat within microphone distance of each other! This feature started out as my Chirp Pong experiment from last week. I pointed Claude Code at that working proof of concept: Opus built this Radio Probe tool to measure how much bandwidth we could get between two devices and, based on positive results from that, implemented a full audio modem system. I've tried it between laptops, iPhones and iPads so far and it seems to work really well! Why use sound for this? Because I love static HTML that costs nothing to run, and I don't want to spin up a server somewhere and then stay responsible for keeping it operating for as long as anyone might want to play the game. I know almost nothing about game development. This makes it a great opportunity to try out coding agents in a field where my existing software engineering experience has less impact on the results. Games are also super low stakes. The worst that can happen is one of my silly game experiments suffers a bug. This morning ( via Hacker News ) I found Steam Fans Are Begging for a No-AI Filter as Steam Next Fest Is Filled With Slop . I wouldn't personally dream of submitting Battle Drones to an event like this - it's still way too low effort to warrant consideration as a legitimate indie gaming project. ... but I can now see a path to vibe coded games like this being taken seriously. Battle Drones is fun, it looks good, it has innovative features (the multiplayer-over-audio thing is a first for an RTS as far as I can tell). I'd love to see what someone with better taste than me and a driving passion to produce something truly exceptional could build! A few other observations from this project: Earlier in this article I said: Games are also super low stakes. The worst that can happen is one of my silly game experiments suffers a bug. Then I tried playing the multiplayer version with Natalie... and the high pitched modem sounds gave her a nasty headache! That's a pretty bad bug. I added a warning and was then inspired to build proper network multiplayer. I tried getting WebRTC to work but couldn't get a connection going between two of my own devices even on my own WiFi network, so I had Claude build a simple, stateless WebSockets relay server instead: Here's the resulting server . Since this scales to zero and runs on a single Fly.io instance it should cost me no more than $2.19/month - and that's if it stays hot and serving connections the whole time. Battle Drones now supports online multiplayer. Click "Duel a friend online", then either share the resulting room URL via your messaging app of choice or have them snap a picture of the displayed QR Code. I also added a feature where you can copy JSON of the match once it has ended and then feed that into the replay feature to rewatch your game. I didn't expect to introduce online multiplayer this soon, but the headache bug felt like it warranted an urgent alternative. You are only seeing the long-form articles from my blog. Subscribe to /atom/everything/ to get all of my posts, or take a look at my other subscription options . Battle Drones How I built this v1: the initial prototype v2: full sprites v3: varied terrain v4: the fun update v5: Battle Drones goes 3D v8: Archipelago v10: Goliath, and agent battles Agent battles v11: Random Maps v12: Multiplayer via sound Some thoughts Update: Online multiplayer support 9 buildings, 7 ground vehicles, 6 aerial vehicles, 3 infantry units - all 3D models, which you can browse here Different weapons are needed to target aerial or ground vehicles Six maps , across five biomes - temperate, desert, arctic, volcanic, tropical A random map generator Skirmish mode - red vs. blue on a rotationally symmetrical map Last Stand mode - one player holds out against as many waves of enemies as possible Area effect weapons: Barrage, EMP, Drop Pod, Sky Hammer Crate drops with bonus resources In-game music that responds to events - it gets more intense as fighting breaks out Different in-game AI personalities (Balanced, Rush, Air Swarm, Boom, Skyforce, Ironclad) AI vs. AI mode, to watch those personalities play each other The Goliath - a giant stomping mech with laser eyes and arm cannons and the ability to establish a new base Mutators that add extra rules or twists A "Daily Op" challenge Ranks and achievements ( Medals ) Agent vs. Agent mode where two LLMs can play Battle Drones against each other A multiplayer mode based on two nearby phones communicating via audio messages, an extension of my earlier experiment with Chirp Pong Openers : pick Blitz, Industry or Air Wing before the clock starts. Call-down powers : Barrage, EMP, Drop Pod and the Sky Hammer orbital strike. Objectives and salvage : Uplink relays, supply drops and wrecks worth scrap. Feel : combat juice, adaptive music, unit voices and an announcer. Command : battle alerts, game speed, saved squads and touch placement. New modes : Last Stand survival waves and an 8-mission Ops campaign. Progression : heroes, an after-action report with awards, a career, 7 mutators and a Daily Op. Goliath Armada starts each side with four airborne Goliaths (each with a pair of Condors) and no other units. Robot Love adds a special rule: if enemy Goliaths get close to each other on the battlefield they fall in love and the game ends in a draw. (Thank Natalie for that one). Static HTML and JavaScript is a fantastic medium for games development. WebGL works great, and Three.js (and Phaser before it) are excellent platforms to build on that the current models know inside out. This also lets them run as Progressive Web Apps - I didn't ask for it, but Battle Drones works offline. I was able to play it on a plane despite never having directly installed it - my phone had it cached. Giving Claude an OpenAI API key and telling it to generate images using OpenAI's models works really well. It can view the images it has generated and iterate on the prompts. Opus 5.5 is spectacular at 3D modeling using Three.js (and Blender, and no doubt other 3D applications as well). The same is true of GPT-6 Astra. They are absolutely capable of building models for 3D game projects. For features like replay and multiplayer it's useful to have a deterministic simulation engine. At one point Claude had to replace calls to and and friends with custom versions because different browsers (Chrome vs. Safari, for example) returned very slightly different numbers, desynchronizing the replay. Opus 5.5 can write music! There are no audio files in this project - the soundtrack is entirely generated through code, varies across different maps, and even gets more intense as the battle heats up. See Scrimshaw Jukebox for a previous experiment with Claude for music composition. I still can't get over how well the prompt "Make it a LOT more fun" worked. Tools are effectively free. I prompted up the Radio Probe , the Model browser , the Agent vs. Agent debug tool , and Claude Code built a bunch of tools for itself that I haven't even explored myself. Audio-based multiplayer between static HTML games works! I hope to see a whole lot more games use this same pattern - in digging around today I've not found much prior art beyond Siner by Alon Horesh and ggwave by Georgi Gerganov (also of fame). Claude Code "Ultracode" burns tokens like there's no tomorrow, but it can also solve complex problems (like adding audio-based multiplayer) from a single prompt. I'm still not quite over the guilt of building software in this way. I don't feel like I've earned the right to create something this good, in a field in which I have so little prior experience! At this point I've shown it to enough people in private that it felt wrong not to publish it for everyone else to see and learn from.

0 views
Josh Comeau 3 weeks ago

The Future of CSS ✨

Every year, browser vendors collaborate via the Interop project to synchronize their efforts on new HTML/CSS/JS features. This year, there’s a ton of super exciting features being considered! In this blog post, we’ll explore the CSS of the future, to get a glimpse of what we’ll soon be able to do.

0 views

Building a Tool for Job Searchers

The job search process can be chaotic, stressful and scary. It's easy to lose track of the progress you've made in a sea of rejection emails. As you progress through the stages, it becomes important to keep track of everyone you talked to and what you discussed. When you have multiple applications going at once, it can become messy! Like any good engineer, I decided to build my own solution! Mostly as a way to keep my mind busy and stay on top of AI tooling, but also because I believe there's real value to a tool that brings notes, scheduling and a CRM into one job search focused package. Source - XKCD I'm calling my project JobCaddy. As of right now it focuses on helping job seekers track where they've applied to, the various stages they've gone through and the people behind each stage. Test account with fake data My eventual goal is to add suggestions on actions you should take. One thing I learned as a hiring manager is that many people forget to focus on the human aspect of the process. The conversations and people you meet are extremely important. As you progress through stages at a company, you should be sending thank personalized thank you letters, referencing previous conversations and able to recall the name of each person you talked to. JobCaddy will act as a mentor of sorts, suggesting follow-ups and helping you prep for next stages based on your notes and people you talked to. Test account with fake data Like I said, this is in part a project for me to stay on-top of AI developments while I'm job searching. I'm using Next.JS deployed on Vercel with a Supabase backend and shadcn/ui for components. I'm building it primarily with Codex and have been leveraging the impeccable skill for styling . My workflow revolves around the Codex CLI in Herdr , dictation via Myse on Ubuntu and tooling management via Mise . I leverage Sublime Text for manual coding. It's been a pretty fun process, allowing me to quickly iterate based on pain points I run into while using JobCaddy for my own job search!

1 views
neilzone 4 weeks ago

A review of the BigMe B6, an Android colour eInk tablet

For quite some time, I have been keen to try an Android device with an eInk screen, particularly a colour one, but I had not found one at a price that I was willing to pay. I saw the BigMe B6 on AliExpress. It was £134.00, and seemed to meet my requirements - including a pocketable 6” screen, and a USB-C port - and I was willing to spend that to give it a try. It arrived quickly, and came with a nice folding case which holds the device magnetically, and turns the screen on and off when opening and closing it. I had 88% charge when it arrived, so I was able to get on an use it straight away. I used to back up all the partitions on the device (except ), in case I needed to restore them. At this point, I was planning on rooting the BigMe B6, but ultimately I decided not to do so. I used for this, using the “Read partitions” function. (I used “Select all partitions”, and also had “Dump GPT” set (which it was by default). I then manually de-selected “userdata”.) I clicked “Read partition(s)” to start the partition dump. This took 20 minutes or so, mainly thanks to the 12 GB “super” partition. I backed up all the existing apks (in case I needed to reinstall them, in the event of rooting the device and uninstalling software): It comes with a lot of unnecessary (to me) stuff on it. I’d prefer a far more plain, unencumbered, device. I used this gist as inspiration, and used to disable a lot of that software. I have not rooted the BigMe B6, so the software is just disabled, not removed. I have seen some posts saying that it tries to work as a USB host by default. Perhaps things have changed, but when I plugged it into a laptop (Debian 13, GNOME), it mounted as a USB client device, just as I would expect. My goal in buying this was to have a cheap-ish device, for recreational stuff. So, I have installed F-Droid, and used F-Droid to install: All run fine. I also installed Heliboard, as an alternative keyboard. I like the customisability, in particular being able to make it smaller and yet easier for me to use than the native keyboard. The launcher is a bit childish, in a “looks poorly hand drawn to me” kind of way, but I don’t spend much time looking at it, so I have not bothered to do anything about replacing it. I’d like to try it with a Bluetooth keyboard at some point, I think, and see what it is like writing in vim or similar. It had some included eBook reading / management software, but I disabled all of it in favour of using KOreader. KOreader has its own quirks (perhaps a blogpost in itself) but, frankly, it does exactly what I need, and it does it well. In particular, I like being able to set the margins and line spacing that I want, and the auto-turn functionality, which flips the page after a set number of seconds, is very handy. The main pain point for me is that I have never successfully managed to sync my library of books - in Calibre - to the internal storage. I think that it is the sheer number of items, but whether I use Calibre’s own sync function, or drag-and-drop, or just , the transfer fails. And I have had one heck of a time trying to remove books from the internal storage, again perhaps because of the number of items in the directory. Frankly, this is annoying, and I wish that I had solved it, but I have not. Instead, I have worked around it, spending an extra £20 for a micro SD card, and accepting that, to copy books to the card, I need to remove it from the BigMe B6, put the micro SD card into a laptop, and rsync the ePubs from my library to it from there. What a pain. I could, in time, experiment with something like syncthing on it, but all I really want is to be able to plug in the eReader, via USB-C, and rsync books to it. But, hey, with a micro SD card and KOreader, I can read my books on it. The screen works really well for this - it is a joy to read on it. Browsing on an eInk screen is an interesting experience, and I have played around with the screen refresh settings to see if I can optimise it a bit. It is, IMHO, surprisingly snappy and browsing the web is no problem unless the site is poorly designed and full of JavaScript, in which case it is tolerable. Watching / streaming videos is possible, but not desirable. Fine at a pinch, or if one likes a sort of cyberpunk aesthetic. But I would not buy the BigMe B6 for watching video. I turn the Wi-Fi off when I am finished, if I am not switching off the device completely. The screen on the BigMe B6 is really nice! The screen refreshes fine, and it is easy to scroll around / use the touch-screen functions. It works a heck of a lot better than I was expecting for the price, to be honest, and I really enjoy reading / browsing on it. It is just as pleasant - if not slightly more pleasant - to read on it than it is on my dedicated eReader. Changing the eInk settings can make a significant difference, with clarity / removal of ghosting coming at the cost of more regular refreshes (which means a flash and a short delay). I want to experiment some more with this, perhaps with per-app settings. The “colour” part of the colour screen is also nice, if a bit of a novelty for me. The colours on the screen are a bit washed out / muted, but it is more than sufficient to display a book cover, or to give a decent enough representation of a photo in a blogpost. It is - of course - nowhere near as good as the colours on a non-eInk screen. Here’s a blogpost by Derick Rethans : Overall, while battery life is not a patch on my Kobo Clara HD, it is absolutely fine. To make the most of it, I turn the device off (as opposed to just pressing the power button, which darkens the screen, but does not power it off), if I am not going to be using it for a while. The trade off is that it takes about 60 seconds to boot. With Wi-Fi turned on, it - unsurprisingly - used the battery more quickly than if Wi-Fi is off. So I keep Wi-Fi off too, unless I am using it. I don’t have any particularly good observations here, other than it being worse than my eReader. I charge it a couple of times a week, or more if I am reading loads or browsing a lot, but obviously YMMV. And that’s fine. I am rarely far away from a USB-C cable. According to the Android “About” pane: The device has five printed buttons at the bottom of the screen. The first two - something that looks like a graph, and one marked “AI” - stopped working once I had disabled some of the unnecessary software. While I cannot change the look/text of these buttons, using “Key Mapper” from F-Droid, I was at least able to re-purpose these. I have not dug too much into this app, but it looks pretty useful in itself. Now, the “graphs” button (which gives a key code of 10018) toggles Wi-Fi (after some scary warning screens about “Expert Mode” in Key Mapper), and the “AI” button (which gives a key code of 10019) launches KOreader. Excellent stuff :) It had a Login screen. I pressed “Skip”. I have not logged in or done any form of registration. It looks like one can register an account with BigMe, but it is not a requirement. I have not found anything that I cannot do for lack of an account. It comes with Google Play, and I guess that one would need to sign in with a Google account to use that, but I have not done so and, again, I have not found anything that I cannot do as a consequence (since I do not use Google Play). The BigMe B6 came with Android 14. I could be wrong, but I should be surprised if it got much in the way of software updates. It came with version 3.0.0 of “BigMe” (whatever that is), and there was no system update available. The version of Android that BigMe is using is clearly intended to be on a phone. For instance, in the shutdown menu, it offers an “SOS” function, to call the emergency services. Not a big deal, and certainly something that I overlook easily for the price, but, well, not great either. I am used to having a lot more settings available to me, in GrapheneOS. The BigMe B6’s settings app is spartan, but so far the only thing that has bugged me is lack of a dark mode control. I can do it using , but that is an unnecessary pain. Instead, I just set dark mode manually in each app. Android settings says that the device is encrypted. But I don’t know what is encrypted. So far, I have not put anything sensitive on it, and I do not plan to do so - I don’t know why, perhaps coming from using GrapheneOS instead of stock Android - but while I am happy to use it for recreational stuff, I can’t quite bring myself to connect it to my email account, for instance. Tusky (Mastodon client) Fennec (browser) Tor Browser Readrops (RSS reader) Device name: Smart Office Notepad Product Code: Color Processor: Octa-core Storage capacity: Available 41.93 GB / Total 64.00 GB Screen resolution: 1072x1448

0 views