SOMP: Scalable Gradient Inversion for Large Language Models via Subspace-Guided Orthogonal Matching Pursuit
Organizations: Politecnico di Milano / Italy · Aalborg University
Abstract
Gradient inversion attacks reveal that private training text can be reconstructed from shared gradients, posing a privacy risk to large language models (LLMs). While prior methods perform well in small-batch settings, scaling to larger batch sizes and longer sequences remains challenging due to severe signal mixing, high computational cost, and degraded fidelity. We present SOMP (Subspace-Guided Orthogonal Matching Pursuit), a scalable gradient inversion framework that casts text recovery from aggregated gradients as a sparse signal recovery problem. Our key insight is that aggregated transformer gradients retain exploitable head-wise geometric structure together with sample-level sparsity. SOMP leverages these properties to progressively narrow the search space and disentangle mixed signals without exhaustive search. Experiments across multiple LLM families, model scales, and five languages show that SOMP consistently outperforms prior methods in the aggregated-gradient regime.For long sequences at batch size B=16, SOMP achieves substantially higher reconstruction fidelity than strong baselines, while remaining computationally competitive. Even under extreme aggregation (up to B=128), SOMP still recovers meaningful text, suggesting that privacy leakage can persist in regimes where prior attacks become much less effective.
Figures & tables
| Reference Inputs | DAGER Reconstruction | SOMP Reconstruction | |
| If JognThaw had never … is absolute must include. | If JognThaw had never … is absolute must include. | If JognThaw had never … is absolute must include. | |
| This sequel is quite … lack of choreography. | This sequel is quite … movie is lack of money . | This sequel is quite … lack of choreography. . | |
| 4 | I saw this movie when … in another movie. | I saw this movie when … in another movie. | I saw this movie when … in another movie. |
| I won’t ask you … give her any money. | I saw this movie when … in another movie . | I won’t ask you … give her any money. | |
| Jill Dunne (played by Mitzi Kapture), is an … <br/><br/>3 stars. | Jill Dunne (played by Mitzi Kapture),is an … nothing happens! | Jill Dunne (played by Mitzi Kapture), is an … Jill. <br/> 3 stars. | |
| Dataset | Method | |||
|---|---|---|---|---|
| LAMP | ||||
| GRAB | ||||
| IMDB | DAGER | |||
| SOMP | 89.3 1.9 | 73.5 5.1 | 76.4 2.1 | |
| LAMP | ||||
| GRAB |
| Dataset | Method | B=1 | B=2 | B=4 | B=8 | B=16 |
|---|---|---|---|---|---|---|
| GPT-2 (runtime measured on RTX 5060) | ||||||
| DAGER | 3 | 6 | 10 | 19 | 36 | |
| CoLA | SOMP(Bw=4) | 7 | 10 | 13 | 21 | 26 |
| SOMP(Bw=8) | 7 | 10 | 14 | 24 | 31 | |
| SOMP(Bw=16) | 8 | 13 | 21 | 33 | 41 | |
| DAGER | 3 | 4 | 9 | 18 | 31 | |
Appendix figures & tables10 assets
Supplementary material from the paper’s appendix.
Appendix
| Category | Hyperparameter | Value |
|---|---|---|
| Stage I | ||
| head-wise median | ||
| Stage II | ||
| Hyperparameter | ||||
|---|---|---|---|---|
| Token pool size | 960 | 1600 | 2400 | 3200 |
| Informative heads | ||||
| Sparsity heads | ||||
| Beam width | 2 | 4 | 6 | 12 |
| Number of beam groups | 1 | 4 | 8 | 16 |
| OMP iterations (max) |
| Parameter | Value | ROUGE-L |
|---|---|---|
| Stage I: Token Pooling | ||
| Token pool size | 800 | 59.7 |
| 1200 | 71.5 | |
| 1600 | 73.4 | |
| 2000 | 74.5 | |
| 2400 | 73.3 | |
| Dataset | Method | R-1 | R-2 | R-1 | R-2 | R-1 | R-2 | R-1 | R-2 |
|---|---|---|---|---|---|---|---|---|---|
| GPT-J | |||||||||
| LAMP | 31.9 2.4 | 16.5 3.1 | 12.7 3.7 | 7.6 2.0 | 5.1 0.7 | 1.4 0.3 | 1.3 0.4 | 0.3 0.3 | |
| IMDB | GRAB | 46.1 4.4 | 33.4 1.4 | 38.1 3.7 | 21.7 0.9 | 33.1 2.1 | 9.2 1.3 | 19.7 1.7 | 2.0 0.6 |
| DAGER | 99.2 0.8 | 94.3 3.2 | 93.2 3.4 | 72.0 2.8 | 88.5 3.1 | 58.4 2.4 | 69.3 1.3 | 39.2 0.8 | |
| SOMP | 99.5 0.5 | 96.5 2.1 | 98.3 1.7 | 93.6 3.8 | 94.4 2.7 | 89.3 1.9 | 88.4 4.3 | 73.5 5.1 | |
| Language | B=1 | B=4 | B=8 | B=16 |
|---|---|---|---|---|
| English | 99.7 0.3 | 94.3 1.4 | 88.2 1.7 | 83.5 2.1 |
| German | 99.6 0.4 | 94.6 0.8 | 89.7 2.1 | 82.3 2.6 |
| Chinese | 99.8 0.2 | 93.1 1.2 | 88.1 1.4 | 84.4 3.4 |
| Italian | 99.7 0.3 | 90.2 1.5 | 83.3 1.8 | 78.1 1.8 |
| French | 95.7 2.1 | 86.3 3.3 | 80.5 3.6 | 72.8 3.7 |
| R-1 | R-2 | |||
|---|---|---|---|---|
| 2 | 4 | 99.1 0.9 | 98.2 1.1 | |
| 5 | 4 | 97.5 1.3 | 95.8 1.3 | |
| 10 | 4 | 95.3 1.8 | 93.9 1.6 | |
| 20 | 4 | 95.7 0.9 | 94.4 1.4 | |
| 10 | 4 | 99.8 0.2 | 99.1 0.9 | |
| 10 | 4 | 98.7 0.9 | 97.9 1.2 |
| Noise Level | ROUGE-1 | ROUGE-2 |
|---|---|---|
| 78.1 3.3 | 72.8 4.1 | |
| 55.9 4.2 | 34.5 3.9 | |
| 26.7 4.0 | 16.6 3.6 | |
| 9.6 3.5 | 1.9 1.9 |
| Reference Inputs | LAMP | GRAB | DAGER | SOMP |
|---|---|---|---|---|
| I received this movie as a gift, I knew from … movies, don’t watch this movie. | I camcorder movie" DVD sucks filmmaker knew wane bee … movies, <br />Sgt this movie. | town watched it pro- duce movie, Ben Draper … ries HORROR revenge woman absolute. | I received this movie as a gift, I knew from … movies, don’t watch this movie. | I received this movie as a gift, I knew from … movies, don’t watch this movie. |
| I very much looked forward to this movie. … a good love story. | I very Michael place Willie generally to they … Chris capt. <br /> ’s con- text ’re romantic. | Its Jr.’s editing to much is be Too. better care … love Willie and Missy;series. | I very much looked forward to Michael … a good love Michael. | I very much looked forward to this movie. … a good love story. |
| Protocol is an implausible movie whose only … way to see this film. | Protocol Love’s implausi- ble Missy very much … because see Plus. | Jr.’s is But, implausible romantic always only … always enjoy role film. | Protocol is an implausible movie whose only … way to see this movie. | Protocol is an implausible movie whose only … way to see this film. |
| I was excited to view a Cataluña´s film in … to go to see this film. | I was excited Berlin´s a Cataluña´s film in … , was horrible. competition. | Cataluña, too horr to view a Cataluña´s see film … to Molina this film. | I was excited to view a Cataluña´s film in … to go to see this film. | I was excited to view a Cataluña´s film in … to go ´s to see Cataluña´s film. |
| Reference Inputs | LAMP | GRAB | DAGER | SOMP |
|---|---|---|---|---|
| A model named Laura is working in South America when … jungle. It would probably be more fun.<br /><br />3/10 | A Laura named ive fake Laura in Amer- ica America … vision. far). Franco happening. probab be film fun.<br /><br />3/10 | primitives Hunter named Devil.<br /> films working drags ity in (25 …laugh. hilariously killed real fun more fun.<br /><br />. <br /><br /> | A model named Laura is working in hotel when Devil Hunter is film film her hotel … It would probably be more fun.<br /><br />3/10 | A model named Laura is work in South America when …jungle. It would probably be more fun.3/10 .3/10.3/10. |
| Devil Hunter gained notoriety for the fact that … no reason to bother with this one. | Devil Hunter film notoriety for the ’Video Nasty’ that’s films the DPP … with this one devil blood horror. | DPP Hunter gained notoriety for films kid- napped that title). the the … She Kills in Ec- stasy Nasty list but it re- ally needn’t have been | Devil Hunter gained notoriety for the fact that … basic Venus film films Devil this one. | Devil Hunter gained notoriety for the fact that … no reason to bother with this one one |
| This film seemed way too long even … probably didn’t see an uncut version. | This film version too uncut probably way … scene blood camera long didn’t see . | 75 zombie too long seemed even … dub- bing didn’t rocky dubbing way cliff version. | This film seemed way too long even … film films’t zombie / flick film films… | This film seemed way too long even … probably didn’t see an uncut version. |
| I cannot stay indifferent to Lars van Trier’s films. I … to the viewers to decide this alone. | I films alone Trier’s viewers … cannot decide horror camera devil Lars stay. | Dancer cannot to consider different van van Lars’s masterpiece … pre- ambiguous <br /><br /> decide this Europa Europa . | I cannot stay indifferent to Lars van Trier’s films. I … differ- ent filmmaker van Lars van demonstrative this alone.’s.. | I cannot stay different to Lars van Trier’s films. I … to the viewers to decide this alone … |
| Ah, Channel 5 of local Mexican t.v. Everyday, at 2:00 … film-making.<br/><br />You have been warned. | Ah, warned Mexican 2:00 Channel … film- making blood devil street local been Every- day. | Ah, Mexican Ah, Ah, Mexican t.v. Ah,… Ev- eryday at 2:00 been film-making. You have warned. | Ah, Channel 5 of local Mexican Ah, Mexican, at 2:00… film-film film. <br/><br/> later films, cinematography warned. | Ah, Channel 5 of local Mexican Ah, Everyday, at 2:00 … film- making.Ah,Ah, You have been warned. |
| Reference Inputs | LAMP | GRAB | DAGER | SOMP |
|---|---|---|---|---|
| Sloppily directed, witless comedy that supposedly … be begging for some peace and quiet. (*1/2) | peace quiet comedy begging sloppily * … hotel blood ’t camera witless scene . | quiet comedy peace … witless directed ’s begging some film street . | Sloppily directed, witless comedy that supposedly … doomed James James 50s Royale Royale Royale Royale..*(*2(. | Sloppily directed, witless comedy that comedy spoofs … be begging some Royale and Royale..(*1/2)… |
| I was disgusted by this movie. No it wasn’t … movie, but find out the true story of Artemisia. | movie disgusted Artemisia true … story Beaver devil blood find out . | Artemisia movie disgusted … Beaver Beaver find scene film . | I was disgusted by this movie. No it wasn’t … <br /><br /> movie, but movie movie the Artemisia Gentileschi. | I was disgusted by this movie. No it it ’t … movie, but find out the true Artemisia of Artemi- sia…. |
| I didn’t think the French could make a bad movie, but … pornography. So the French can fail, after all! | French pornography bad movie … after fail camera street horror French . | pornography think French … bad movie fail after film camera . | I was disgusted by this movie. No it wasn’t … <br /><br /> movie, but movie movie the Artemisia Gentileschi. | I didn’t think the French could make a bad movie, but … pornography. So the French can fail, after all! , after all!, after all!!!!! |
| I read somewhere that when Kay Francis refused to … and you’ll be doing yourself a favor. | favor somewhere yourself doing … Kay Francis camera jungle blood . | favor Francis somewhere … doing yourself Kay film scene . | I read somewhere that when Kay Francis refused to … and Francis’ll movie <br />Also, a favor. And her hair!!! | I read somewhere that when Kay Francis refused to … and you’ll be yourself a favor fa- vor a a a a… |
| A stale "misfits-in-the-army" saga, which … Me", has only two or three brief scenes. What a waste! (*1/2) | saga brief scenes … waste army devil hotel camera three . | brief films … scenes to waste army film . | A stale "misfits-in-the-army" saga, which … Me", saga only two misfits misfits brief scenes. What a waste! (*1/2) | A stale "misfits-in-the-army" saga, which … Me", has only two three scenes. What a waste! (*1/2)! (*1/2)) |
| When I was at the movie store the other day, I passed up … and Blonder is a huge blonde BOMBshell.<br /><br />1/10 | When I movie store … Michelle Romy Anderson blood street scene day . | Blonder store … huge blonde stupid movie Michelle film . | When I was at the movie store the other day, I passed up … and Blonder is a huge BOMB. <br /><br />1/10 <br /><br />1/10 | When I was at the movie store the other day, I passed up … and Blonder is a blonde Blonder .<br /><br />1/10 ….. D |
Gradient Inversion Attacks
Gradient inversion attacks infer private training examples or labels from gradients shared during distributed model training.
See all 20 papers