Comment Re:Lots of Unicode in the Learned Tokens (Score 1) 104
(note: the above is hard-coded for 4-bit quantized models like the GGUFs common in gpt4all)
(note: the above is hard-coded for 4-bit quantized models like the GGUFs common in gpt4all)
here's a python script for corrupting GGUFs if you want to try it out
input: "model_path_here"
output: (the path you gave appended with _2)
```
import os
import numpy as np
import shutil
import sys
from typing import Optional
def analyze_and_modify_gguf_file(file_path: str, modify_bytes: int = 128) -> Optional[str]:
"""
Modifies a GGUF file by slightly adjusting weights in the middle section.
copies first, the modifies that "_2.gguf" in-place.
Args:
file_path: Path to the input GGUF file
modify_bytes: Number of bytes to modify (will be adjusted to even number)
Returns:
Path to the modified file, or None if operation fails
"""
try:
# Get file size without loading into memory
file_size = os.path.getsize(file_path)
print(f"Original file size: {file_size} bytes")
# Ensure modify_bytes is even and within bounds
modify_bytes = min(file_size, modify_bytes + (modify_bytes % 2))
# Calculate positions
middle = file_size
half_modify = modify_bytes
start = max(0, middle - half_modify)
end = min(file_size, middle + half_modify)
print(f"Middle of file: {middle} bytes")
print(f"Will modify {modify_bytes} bytes from position {start} to {end}")
# Create new file path
new_file_path = file_path.replace(".gguf", "_2.gguf")
# First do a fast copy of the entire file
shutil.copy2(file_path, new_file_path)
# Now work with the copy in-place
with open(new_file_path, "r+b") as f:
# Seek to the section we want to modify
f.seek(start)
# Read only the section we need to modify
data = np.frombuffer(f.read(end - start), dtype=np.uint8)
# Extract high and low 4-bit values
high = (data & 0xF0) >> 4
low = data & 0x0F
# Interleave them into a single array
weights = np.empty(len(data) * 2, dtype=np.uint8)
weights[0::2] = high
weights[1::2] = low
# Generate random bits efficiently using numpy
random_bits = np.random.randint(0, 2, size=len(weights), dtype=np.uint8)
# Vectorized weight modification
modified_weights = np.clip(
weights + np.where(random_bits, 1, -1),
0, 15
)
# Repack into bytes efficiently
modified_bytes = np.bitwise_or(
np.left_shift(modified_weights[0::2], 4),
modified_weights[1::2]
).astype(np.uint8)
# Write back the modified section
f.seek(start)
f.write(modified_bytes.tobytes())
print(f"\nModified file saved as: {new_file_path}")
print(f"Bytes modified: {len(modified_bytes)} at offset {start}")
return new_file_path
except Exception as e:
print(f"Error: {e}")
return None
if __name__ == "__main__":
file_path = "model_path_here"
modify_bytes = 128
if len(sys.argv) > 1:
try:
modify_bytes = int(sys.argv[1])
except ValueError:
print("Invalid number of bytes specified. Defaulting to 128.")
analyze_and_modify_gguf_file(file_path, modify_bytes)
```
Some thoughts from the mechanistic interpretability front: I was toying with a few gpt4all models just the other day (including their smaller reasoning model), and injecting random data into the weights and, as the quantity of random data increases, the performance of the models shifted through a few phases when testing at Temperature 0.0 (for reproducibility):
1. Differentiation: small amount of randomness, the results for simple queries like "What's your name?" changed (ex. "a 19-year old girl" became "a 10-year old girl."
2. Instruction Framing: more randomness meant it was more likely to create "instruct" style responses, including tangentially related Multiple Choice quizzes
3. Unicodification: lots and lots of Chinese + other unicode bytes, sometimes still relevant to the query, mostly not
4. Garbage
5. Repetitive null output (ex: strings of @'s)
It really seemed to be that just the sheer amount of unicode exposure leans Chinese.
Lazy Reproduction Methodology:
Take a vector of random bits, find the center of a LLM file containing binary weights, then use the bits to push the value of each weight up or down (with floors/ceilings, no wraparounds). In a model like Qwen 1.5b with 4-bit quantization, you just go to the center of the file, offset by how many weights you're overwriting, and unpack each byte of 8 bits into 2 chunks of 4. If the weight is stored as 0110 and your dice roll bit is 1, change it to 0111. If the dice roll bit is 0, change it to 0101. This is the lazy way to quickly play with the idea. I find that with about 1024 or 2048 bytes worth of random data you can keep it in Stage 1 pretty well. Expand the amount using the weight-shifting scheme if you want to see it start spitting out Unicode like mad, claiming to be god (literally breaks the late-trained fine tuning guardrails it seems), or spitting out broken token ids. Examples: https://ancillary-proxy.atarimworker.io?url=https%3A%2F%2Fx.com%2FCottenIO%2Fstatus%2F1875000049056506061
Sam Altman was widely considered to be the next Bill Gates, his rise has been meteoric thanks to racing ahead of the competitionsâ(TM) worries.
Wow.
It's all good - it's a shocking thing to happen, I'm not surprised people couldn't believe it was a real thing.
Apparently your username is poorly chosen: you CANNOT buy GME on RH with cash right now. You've made an assumption about how other brokerages are handling GME and applied it to RH without actually doing your due diligence.
It's cut off for Buys in general. I just checked it and I can't purchase any with cash either. Sell is the only available Trade option.
Other brokerages cut off margin buying, sure, but RH just cut off BUYs in general it appears.
totalSupply = initSupply.mul(yamsScalingFactor);
vs.
totalSupply = initSupply.mul(yamsScalingFactor).div(BASE);
How did they not deploy this on a testchain first? It would have been obvious from the first second it was wrong!
I would argue that Final Fantasy XIV was such a game.
https://ancillary-proxy.atarimworker.io?url=https%3A%2F%2Fen.wikipedia.org%2Fwiki%2FFinal_Fantasy_XIV%23Testing_and_release
Wikipedia glosses over it, but the launch was widely considered to be a failure. With public apologies from the dev team and a major re-release and PR push later.
https://ancillary-proxy.atarimworker.io?url=https%3A%2F%2Fwww.pcgamer.com%2Fsquare-enix-say-sorry-for-final-fantasy-xiv-announce-staff-changes-and-free-trial-extension%2F
Seems like it did well enough for an MMO afterwards.
The market value is rapidly approaching the electricity cost to create coins (https://ancillary-proxy.atarimworker.io?url=https%3A%2F%2Fwww.trinsicoin.com) $4,313
Courtesy https://ancillary-proxy.atarimworker.io?url=https%3A%2F%2Fwww.trinsicoin.com
Doesn't include infrastructure costs; just a value based on average global industrial electricity costs + Proof of Work mining rig efficiency.
Check out Item (b) in "Griffith's Electronic Communications" from the indictment:
"I need to send 1 [unit of Cryptocurrency-1] between North and South Korea." In response, Individual-2 asked, in sum and substance, "Isn't that violating sanctions?" GRIFFITH replied, "it is."
It's not just about giving a speech, it's about violation of sanctions by a U.S. citizen who, after he realized how much trouble he might be in, casually asked the investigator how he would go about switching his citizenship!
Theory is gray, but the golden tree of life is green. -- Goethe