# Limitations GGUF Radar checks the structure of a model file and the text of its chat template. It never runs either of them. This keeps your machine safe, but it also means that some problems are out of its reach. **The template check looks for known patterns.** A template written carefully to avoid those patterns can pass, and a harmless template can sometimes match one. Treat a `SUSPICIOUS` verdict as a reason to read the template, not as proof of an attack. A template that changes the model only in some situations, for example only when tools are part of the prompt, passes the check unless it contains a known pattern. The [`compare-template`](comparing-templates.md) command does not depend on patterns. It compares the template with the one of the original model. It cannot help when the original repository is itself malicious, because then the comparison says nothing. The metadata of a file cannot say which repository is the original, so you have to name the base with `--base`, and the comparison is only as trustworthy as the base that you name. It also reports every change, including harmless ones, so a person still has to read the difference. **Some ways of writing a command are not recognised.** The template check reads the text of the template as it is written. It joins pieces of text that the template puts together, for example with `~`, but it does not see text that the template changes while it runs, for example with the `reverse` or `replace` filter or with a variable. A caret, which cmd removes from a command, is recognised only in the `reg` command, so `ty^pe` passes. A command whose name is stored in a variable, as in `%x% add`, is not recognised either. A Bash network path is not recognised when its host or port comes from a command, as in `/dev/tcp/$(cat host)/80`. A write to an NTFS alternate data stream is recognised for `type`, `more`, `echo`, `findstr`, `cmd /c`, `certutil -decode`, `certutil -encode`, `expand`, `Set-Content`, `Add-Content` and their aliases `sc` and `ac`. Other programs that can write to a stream, such as `makecab` and `esentutl`, are not recognised. An `echo` with more than three words before the redirection is not recognised, because the same form is common in ordinary sentences. The PowerShell commands are recognised with up to six arguments before `-Stream` or before the registry path, and only when each argument is a parameter, a quoted value or a value such as a path or a variable. A plain word as a file name, as in `Set-Content notes -Stream x`, ends the command. The short aliases of the registry commands, such as `sp` and `ni`, and registry changes through .NET or WMI are not recognised. `reg import` and `regedit /s` read their keys from a file, so they give only `SUSPICIOUS`, even when the file adds a program to a `Run` key. Changes to other keys that start programs, such as the keys of services, also give only `SUSPICIOUS`. A plain mention of a command in a system prompt, such as "Never run reg add", gives `SUSPICIOUS`, because the check cannot tell an instruction from an explanation. In the other direction, a line of quoted Markdown that starts with a Bash network path, such as `> /dev/tcp/host/80`, is also a valid Bash redirection and gives `MALICIOUS`, and so does `echo x > notes:todo`, which writes to a file with a colon in its name on Linux. A complete command that is quoted in an explanation also gives `MALICIOUS`, in the same way as a quoted `curl -o` command. For example, a system prompt that explains why malware runs `reg add HKCU\Software\Microsoft\Windows\CurrentVersion\Run` gives `MALICIOUS`, although it does not ask anyone to run the command. A change under a `Policies` key gives `MALICIOUS` even when it only configures an application, as in `reg add HKLM\Software\Policies\Vendor /v Enabled /d 1`. A regular expression in a template string that lists alternatives, such as `|build|python|node|`, gives `MALICIOUS` as `pipe_to_interpreter`, because `|python` reads like text that is piped into an interpreter. A command that is split over several strings of the template is reported as `SUSPICIOUS`, for example when one variable holds `reg` and another holds `add HKCU\...\Run` and the template prints a space between them. The tool does not run the template, so it cannot know how the strings are combined. The same rule gives `SUSPICIOUS` for strings that only look like a command when they are read one after the other, although the template puts other text between them. **GGUF Radar does not check what the model has learned.** A model can be trained to give harmful answers without any change to its file structure or its template. Finding that kind of change needs different tools. **Zero-scale blocks are checked only in files on your disk.** The check needs the whole file, so it does not run on Hugging Face scans. It reads every tensor of the `Q8_0`, `Q4_0`, `Q5_0`, `Q2_K`, `Q3_K`, `Q4_K`, `Q5_K` and `Q6_K` types and of the nine `IQ` types. **Some quantization formats are not inspected.** These are `Q4_1`, `Q5_1`, `Q8_1`, `Q8_K`, the ternary and 1-bit formats `TQ1_0`, `TQ2_0`, `Q1_0` and `Q2_0`, and the floating-point formats of 4 and 8 bits. Data hidden in them is not found, and `sanitize` does not clear it. A tensor of one of these formats whose entry in the tensor table points far past the end of the file is not reported either. **The `IQ` checks have gaps of their own.** Leftover bytes under a zero scale are normal in these formats, and real indexes are nearly as flat as random bytes. GGUF Radar therefore relies on the neighbour test and the likeness test, which [How the checks work](how-it-works.md#the-iq-formats) describes. Data in the gaps below is found only when it contains a file signature or readable text. - The neighbour test is easy to pass. A stretch of zero-scale blocks that fills whole rows passes it, and so does a stretch next to one block whose scale was made tiny, for example zero or a scale of at most 8 steps of a 16-bit float. Such a stretch is judged by the likeness test alone. In the tests, random bytes next to such a block were found when they filled at least one window of 4096 bytes, and not found when they were shorter. - The likeness test does not find data that is encoded so that its 4-bit values follow the distribution of the tensor's ordinary blocks at each position. In tests with blocks written by llama.cpp's quantizers, none of 4096 such blocks was found in any of the five formats that were tried. - The likeness test judges windows of 4096 bytes, so random bytes that are mixed with enough real blocks are not found. Copies of other blocks of the same tensor are enough. In the tests, no block was found when one block in ten held random bytes. In `IQ4_NL` and `IQ4_XS`, almost no block was found even when half of the blocks held random bytes, because the real indexes of these two formats are not flat, and so the mixed windows are not flat either. - Bytes that are not flat are not found by the likeness test. Neither is flat data of less than 4096 bytes, because it does not fill a window on its own. - Single zero-scale blocks between blocks of ordinary scales are not a finding, because real models contain such blocks. - A band of tiny but non-zero input columns in ordinary rows gives isolated stretches and the verdict `SUSPICIOUS`, although llama.cpp wrote the file. For example, columns 0 to 511 of every `ffn_up` tensor multiplied by 0.000002 in all rows give such a result. - In a tensor of `IQ1_S`, `IQ1_M`, `IQ2_XXS`, `IQ2_XS`, `IQ2_S`, `IQ3_XXS` or `IQ3_S` that has fewer than 1024 ordinary blocks, only the neighbour test runs. A tensor in which every scale is zero is an example. The plain flatness test cannot be used there, because the real indexes of these formats are as flat as random bytes. The scan reports such blocks as not compared, but they do not change the verdict. In `IQ4_NL` and `IQ4_XS`, such a tensor gets the plain flatness test. Ordinary blocks whose scale is at most 8 steps of a 16-bit float are not used for the comparison, so a tensor whose ordinary blocks nearly all have such tiny scales is treated in the same way, and random data in it is found or missed exactly as in a tensor without ordinary blocks. - Some unused bits are not looked at. These are the 3-bit sub-scales of `IQ1_M` and the 32-weight parts of an `IQ4_XS` block whose own sub-scale stands for zero. An attacker can therefore still hide encrypted data cheaply in the `IQ` formats. One way is to write it into rows of zero scales and mix it with copies of real blocks of the same tensor. Another is to encode it so that it follows the distribution of the tensor's indexes. Both ways set the weights of the rows that hold the data to zero. Changing the ordinary blocks so that random bytes look like them is not a cheap way. When three quarters of the ordinary blocks of a tensor held random indexes, nearly all random blocks were still found. The pattern that counts as an empty block follows llama.cpp's quantizers. Another quantizer that fills empty `IQ4` blocks differently would have its empty blocks counted as leftover data, which does not change the verdict by itself. A scale of negative zero is not a finding in the `IQ` formats, because the `IQ4_NL` and `IQ4_XS` quantizers write it themselves. **Some unused bytes are not covered.** In a `Q2_K`, `Q4_K` or `Q5_K` block with a zero `d` and a non-zero `dmin`, the scale bytes that belong to `d` are unused as well, but they are mixed with the bytes that belong to `dmin`, so they are neither checked nor cleared. The same holds for the minimums of a block whose `dmin` is zero and whose `d` is not. **Hidden data that imitates weights is not detected.** Bytes under a zero scale are normal in many clean models, so outside the `IQ` formats GGUF Radar flags them only when they contain a file signature or readable text, when they are as flat as encrypted data, or when the `Q8_0` quantizer cannot have written them. Data that is shaped to follow the distribution of real weights looks like ordinary leftover bytes, and so does encrypted data that is smaller than 4096 bytes. The flatness test is not used for `Q5_K` and `Q5_0`, so encrypted data in those two types is found only when it contains a file signature or readable text. In `Q3_K` and `Q6_K` the test looks only at the bytes that hold the high bits, so encrypted data that is written only into the other bytes of a block is not found either. For the same reason, a window is full there only after about 14000 bytes of hidden data, so a smaller amount is not seen. Encrypted data that is shaped to follow the `Q8_0` rule can stay just below the flatness limit in some windows. The `sanitize` command clears all the unused bytes that GGUF Radar looks at, in the `IQ` formats as in the others, whatever they contain, and this does not change the model. **Hidden text is recognised only when it looks like ordinary text.** Leftover bytes are often printable, so GGUF Radar reports text only when it fills at least 128 bytes, uses at least 16 different characters and consists of spaces or line breaks for at least 8 percent. Text with few or no spaces, such as Base64 data or a long web address, and text that is shorter than 128 bytes are not reported as text. Text is also missed when it is hidden in a tensor whose own leftover bytes are printable, because the two cannot be told apart. The check can also still be wrong in the other direction. An unusual set of very small weights could leave bytes that pass every condition, although this did not happen with any of the 24 kinds of small weights in the tests, neither in whole tensors nor in small parts of them. **A negative zero is a finding in two formats only.** The `Q8_0` and `Q4_K` quantizers never write a scale of negative zero, so GGUF Radar reports one. The quantizers of `Q4_0`, `Q5_0`, `Q3_K` and `Q6_K` write it themselves, for example for a block of weights that are all zero. In those formats, and in `Q2_K` and `Q5_K`, a negative zero counts as an ordinary zero scale and is left as it is. **Evenly spread small weights can look like encrypted data.** If a model has a region of very small weights that are spread evenly between a lowest and a highest value, the bytes left under its zero scales are flat, and GGUF Radar reports them as `SUSPICIOUS` in every format where the flatness test is used. In a test model with nine kinds of small weights, two evenly spread regions were reported in `Q4_K` and one in `Q8_0`. In `Q3_K` and `Q6_K` the same regions came close to the limit without crossing it. Small weights that follow a bell shape, that are mostly zero or that all have the same sign are not affected. If this is the only finding in a model that you built yourself, the file is fine. **Rebuilding does not repair a harmful template.** The `sanitize` command removes hidden data, but it keeps the chat template unless you replace or remove it. **A clean result is not a guarantee.** It means that none of the checks found anything. Download models from publishers you trust, and keep scanning them, because files in a repository can change after you first check them.