text stringlengths 0 412k |
|---|
July 2010What hard liquor, cigarettes, heroin, and crack have in common is |
that they're all more concentrated forms of less addictive predecessors. |
Most if not all the things we describe as addictive are. And the |
scary thing is, the process that created them is accelerating.We wouldn't want to stop it. It's the same process that cures |
diseases: technological progress. Technological progress means |
making things do more of what we want. When the thing we want is |
something we want to want, we consider technological progress good. |
If some new technique makes solar cells x% more efficient, that |
seems strictly better. When progress concentrates something we |
don't want to want—when it transforms opium into heroin—it seems |
bad. But it's the same process at work. |
[1]No one doubts this process is accelerating, which means increasing |
numbers of things we like will be transformed into things we like |
too much. |
[2]As far as I know there's no word for something we like too much. |
The closest is the colloquial sense of "addictive." That usage has |
become increasingly common during my lifetime. And it's clear why: |
there are an increasing number of things we need it for. At the |
extreme end of the spectrum are crack and meth. Food has been |
transformed by a combination of factory farming and innovations in |
food processing into something with way more immediate bang for the |
buck, and you can see the results in any town in America. Checkers |
and solitaire have been replaced by World of Warcraft and FarmVille. |
TV has become much more engaging, and even so it can't compete with Facebook.The world is more addictive than it was 40 years ago. And unless |
the forms of technological progress that produced these things are |
subject to different laws than technological progress in general, |
the world will get more addictive in the next 40 years than it did |
in the last 40.The next 40 years will bring us some wonderful things. I don't |
mean to imply they're all to be avoided. Alcohol is a dangerous |
drug, but I'd rather live in a world with wine than one without. |
Most people can coexist with alcohol; but you have to be careful. |
More things we like will mean more things we have to be careful |
about.Most people won't, unfortunately. Which means that as the world |
becomes more addictive, the two senses in which one can live a |
normal life will be driven ever further apart. One sense of "normal" |
is statistically normal: what everyone else does. The other is the |
sense we mean when we talk about the normal operating range of a |
piece of machinery: what works best.These two senses are already quite far apart. Already someone |
trying to live well would seem eccentrically abstemious in most of |
the US. That phenomenon is only going to become more pronounced. |
You can probably take it as a rule of thumb from now on that if |
people don't think you're weird, you're living badly.Societies eventually develop antibodies to addictive new things. |
I've seen that happen with cigarettes. When cigarettes first |
appeared, they spread the way an infectious disease spreads through |
a previously isolated population. Smoking rapidly became a |
(statistically) normal thing. There were ashtrays everywhere. We |
had ashtrays in our house when I was a kid, even though neither of |
my parents smoked. You had to for guests.As knowledge spread about the dangers of smoking, customs changed. |
In the last 20 years, smoking has been transformed from something |
that seemed totally normal into a rather seedy habit: from something |
movie stars did in publicity shots to something small huddles of |
addicts do outside the doors of office buildings. A lot of the |
change was due to legislation, of course, but the legislation |
couldn't have happened if customs hadn't already changed.It took a while though—on the order of 100 years. And unless the |
rate at which social antibodies evolve can increase to match the |
accelerating rate at which technological progress throws off new |
addictions, we'll be increasingly unable to rely on customs to |
protect us. |
[3] |
Unless we want to be canaries in the coal mine |
of each new addiction—the people whose sad example becomes a |
lesson to future generations—we'll have to figure out for ourselves |
what to avoid and how. It will actually become a reasonable strategy |
(or a more reasonable strategy) to suspect |
everything new.In fact, even that won't be enough. We'll have to worry not just |
about new things, but also about existing things becoming more |
addictive. That's what bit me. I've avoided most addictions, but |
the Internet got me because it became addictive while I was using |
it. |
[4]Most people I know have problems with Internet addiction. We're |
all trying to figure out our own customs for getting free of it. |
That's why I don't have an iPhone, for example; the last thing I |
want is for the Internet to follow me out into the world. |
[5] |
My latest trick is taking long hikes. I used to think running was a |
better form of exercise than hiking because it took less time. Now |
the slowness of hiking seems an advantage, because the longer I |
spend on the trail, the longer I have to think without interruption.Sounds pretty eccentric, doesn't it? It always will when you're |
trying to solve problems where there are no customs yet to guide |
you. Maybe I can't plead Occam's razor; maybe I'm simply eccentric. |
But if I'm right about the acceleration of addictiveness, then this |
kind of lonely squirming to avoid it will increasingly be the fate |
of anyone who wants to get things done. We'll increasingly be |
defined by what we say no to. |
Notes[1] |
Could you restrict technological progress to areas where you |
wanted it? Only in a limited way, without becoming a police state. |
And even then your restrictions would have undesirable side effects. |
"Good" and "bad" technological progress aren't sharply differentiated, |
so you'd find you couldn't slow the latter without also slowing the |
former. And in any case, as Prohibition and the "war on drugs" |
show, bans often do more harm than good.[2] |
Technology has always been accelerating. By Paleolithic |
standards, technology evolved at a blistering pace in the Neolithic |
period.[3] |
Unless we mass produce social customs. I suspect the recent |
resurgence of evangelical Christianity in the US is partly a reaction |
to drugs. In desperation people reach for the sledgehammer; if |
their kids won't listen to them, maybe they'll listen to God. But |
that solution has broader consequences than just getting kids to |
Retrieval Head
This is the open-source code for paper: Retrieval Head Mechanistically Explains Long-Context Factuality.
This code is implemented based on Needle In a HayStack.
【Update】 Support Phi3 now, thanks to the contribution made by @Wangmerlyn.
Retrieval Head Detection
An algorithm that statistically calculate the retrieval score of attention heads in a transformer model. Because FlashAttention can not return attention matrix, this algorithm is implemented by first caching with FlashAttention and apply normal attention for decoding.
Environment
Core: pytorch=2.0.1, transformers=4.37.2, flash-attn=2.5.6 (my environment)
Other: rouge_score
A Single 80G GPU is enough to detect up to 50K length.
Usage :
python retrieval_head_detection.py --model_path $path_to_model --s 0 --e 50000
We find that only few samples can stablely detect some of the strongest retrieval heads. I if you are in a hurry or no fancy large GPUs avalible, you can just set '--e' to a lower value, e.g.
python retrieval_head_detection.py --model_path $path_to_model --s 0 --e 5000
Results of retrieval score will be write in './head_score/$model_name.json' Currently Implemented Model Families: LLama(Llama-2-7B-80K), Yi, Qwen, Mistrial
Results:
All detection results are saved in "./head_score/*.json", where each head is saved in the format of
{layer-head_id: [list of retrieval scores across detections]}
Directly load a results for Analysis
## load head score file, llama-2-7b-80k for example
import json
import numpy as np
with open('./head_score/llama-2-7b-80k.json') as file:
head_list = json.loads(file.readline())
## use the average retrieval score and ranking
head_score_list = [([int(ll) for ll in l[0].split("-")],np.mean(l[1])) for l in head_list.items()]
head_score_list = sorted(head_score_list, key=lambda x: x[1], reverse=True)
top_retrieval_heads = [[l[0], round(np.mean(l[1]), 2)] for l in head_score_list][:10]
print(top_retrieval_heads)
'''
Head:[16, 19], Retrieval Score: 0.94 Head:[11, 15], Retrieval Score: 0.92
Head:[8, 26], Retrieval Score: 0.8 Head:[6, 9], Retrieval Score: 0.62
Head:[7, 12], Retrieval Score: 0.61 Head:[17, 22], Retrieval Score: 0.56
Head:[11, 2], Retrieval Score: 0.46 Head:[6, 16], Retrieval Score: 0.44
Head:[19, 15], Retrieval Score: 0.42 Head:[21, 30], Retrieval Score: 0.4
'''
Influence on Needle-in-a-Haystack
This code is implemented by masking the given head in the attention matrix or masking the query in FalshAttention.
Usage:
Setting --mask_top to K > 0 to mask out top K retrieval heads, K < 0 to mask out K random heads, K = 0 for no masking.
A Single 80G GPU can test up to ~70K length, 2*80G GPU can test up to 100K length
Masking top 30 retrieval heads vs 30 random heads:
python needle_in_haystack_with_mask.py --mask_top 30 --s 1000 --e 100000 --model_path $path_to_model #Results of will be written in './results/graph/llama-2-7b-80k_block_top30'
python needle_in_haystack_with_mask.py --mask_top -30 --s 1000 --e 100000 --model_path $path_to_model #Results of will be written in './results/graph/llama-2-7b-80k_block_random30'
Reulsts and Visualization:
Replace 'model_name' in './viz/CreateVizFromLLMTesting.ipynb' by the folder name of Needle-in-a-Haystack results.
Mask top 30 Retrieval Head for Llama-2-7b-80K:
Mask random 30 non-Retrieval Head for Llama-2-7b-80K:

- Downloads last month
- 9,826