Meta AI simply launched Brain2Qwerty v2. It decodes pure sentences from non-invasive mind recordings in actual time. The system reads magnetoencephalography (MEG) alerts whereas an individual sorts. It reconstructs what they typed, with no implant and no surgical procedure. That is the follow-up to Brain2Qwerty v1, launched in February 2025. Meta can also be releasing the total coaching code for each variations. The pipeline combines a convolutional encoder, a transformer, and a character-level language mannequin.
TL;DR
- Brain2Qwerty v2 decodes typed sentences from non-invasive MEG alerts, with no implant or surgical procedure.
- It reaches 61% common phrase accuracy (39% WER), up from 8% for prior non-invasive strategies.
- The perfect participant hit 78% phrase accuracy, with over half of sentences at one phrase error or much less.
- The pipeline pairs a convolutional encoder, transformer, and character-level language mannequin, plus fine-tuned LLMs.
- Accuracy scales log-linearly with knowledge; coaching code for v1 and v2 is launched below CC BY-NC 4.0.
What’s Brain2Qwerty v2?
Brain2Qwerty v2 is a brain-to-text decoder. It maps uncooked mind exercise to characters, then to phrases and sentences.
Meta educated it on roughly 22,000 sentences from 9 volunteer members. Every participant was recorded for 10 hours whereas actively typing.
Recordings come from a MEG gadget. MEG measures the magnetic fields produced by neuronal exercise, sampled at excessive temporal decision.
The mannequin leverages character, phrase and sentence-level representations. That layered design lets it appropriate native errors utilizing broader context.
Importantly, that is analysis, not a product. The decoder will not be a client gadget, and it was examined on a small group of volunteers.
The info was collected with Spain’s BCBL (Basque Middle on Cognition, Mind and Language). It belongs to that analysis heart.
How the Decoding Pipeline Works
Earlier non-invasive programs relied on hand-crafted pipelines to detect neural occasions. Brain2Qwerty v2 replaces that step with end-to-end deep studying.
Per Meta’s repository, the mannequin combines three parts: a convolutional encoder, a transformer, and a character-level language mannequin.
The convolutional encoder reads uncooked MEG alerts. It learns options straight from the information as an alternative of utilizing engineered occasion detectors.
The transformer fashions longer-range construction throughout the sign. The character-level language mannequin then constrains the output towards believable textual content.
Meta analysis workforce describes 3 ways AI permits the outcome. Every maps to a concrete engineering resolution groups will acknowledge.
- Deep studying replaces hand-crafted occasion detection.
- Giant language fashions are fine-tuned to extract semantic representations.
- AI brokers iteratively refined the decoding pipeline by means of automated code improvement. Ultimate coaching configurations have been nonetheless chosen manually by devs
Nice-tuning giant language fashions on neural knowledge provides semantic context. That context bridges noisy mind recordings and coherent language output.
In follow, the language mannequin rejects character sequences that kind no actual phrases. It pushes the decoder towards sentences a human would plausibly kind.
Right here is an illustrative sketch of the printed structure. It mirrors the described parts and isn’t Meta’s actual coaching code.
import torch
import torch.nn as nn
class Brain2QwertySketch(nn.Module):
"""Illustrative: convolutional encoder -> transformer -> char-level head.
Displays the parts Meta describes, not the official implementation."""
def __init__(self, n_meg_channels=306, d_model=256, n_chars=40):
tremendous().__init__()
# 1) Convolutional encoder over uncooked MEG channels x time
self.encoder = nn.Sequential(
nn.Conv1d(n_meg_channels, d_model, kernel_size=7, padding=3),
nn.GELU(),
nn.Conv1d(d_model, d_model, kernel_size=5, padding=2),
nn.GELU(),
)
# 2) Transformer fashions temporal construction
layer = nn.TransformerEncoderLayer(d_model, nhead=8, batch_first=True)
self.transformer = nn.TransformerEncoder(layer, num_layers=6)
# 3) Character-level head; a language mannequin refines this downstream
self.char_head = nn.Linear(d_model, n_chars)
def ahead(self, meg): # meg: (batch, channels, time)
x = self.encoder(meg) # (batch, d_model, time)
x = x.transpose(1, 2) # (batch, time, d_model)
x = self.transformer(x) # contextualized options
return self.char_head(x) # (batch, time, n_chars)
To work with Meta’s actual code, clone the repository and examine each variations:
git clone https://github.com/facebookresearch/brain2qwerty
# brain2qwerty_v1/ and brain2qwerty_v2/ maintain the coaching code
The Accuracy Numbers
Brain2Qwerty v2 achieves a median phrase accuracy price of 61%. That corresponds to a phrase error price (WER) of 39%.
For the very best participant, the mannequin reaches 78% phrase accuracy. For that participant, over half of sentences had one phrase error or much less.
The prior baseline issues right here. Meta reviews that different non-invasive strategies reached solely 8% phrase accuracy.
Accuracy additionally improves log-linearly with knowledge quantity. Extra recording hours predictably increase accuracy within the reported vary.
That scaling habits is the important thing declare for builders. It suggests the hole with surgical implants may slender by means of knowledge alone.
| Metric | Brain2Qwerty v2 | Prior non-invasive strategies |
|---|---|---|
| Common phrase accuracy | 61% | 8% |
| Common phrase error price (WER) | 39% | — |
| Finest participant phrase accuracy | 78% | — |
| Recording methodology | MEG, non-invasive | Non-invasive |
| Scaling habits | Log-linear with knowledge | — |
These numbers come from volunteers in a managed setting. They aren’t medical outcomes for sufferers with mind accidents.
v1 vs v2: What Modified
Brain2Qwerty v1 and v2 report totally different metrics, so examine them fastidiously. v1 was measured at character stage, v2 at phrase stage.
| Facet | Brain2Qwerty v1 (Feb 2025) | Brain2Qwerty v2 (Jun 2026) |
|---|---|---|
| Gadgets | MEG and EEG | MEG |
| Contributors | 35 wholesome volunteers | 9 volunteers |
| Knowledge | Typed sentences | ~22,000 sentences, 10 hours every |
| Reported outcome | As much as 80% of characters (MEG) | 61% common phrase accuracy |
| Illustration stage | Character-level | Character, phrase and sentence-level |
| Actual-time decoding | Not emphasised | Actual-time sentence decoding |
v1 additionally confirmed MEG decoding was at the very least twice higher than the EEG system. EEG alerts are noisier, which limits accuracy.
Use Instances With Examples
- The first motivation is restoring communication. Thousands and thousands of individuals have mind lesions that stop them from talking or shifting.
- Invasive strategies like stereotactic electroencephalography and electrocorticography already feed a neuroprosthesis to an AI decoder. However they require neurosurgery and are arduous to scale.
- A non-invasive decoder may widen entry. A affected person may doubtlessly kind sentences with out an implant, utilizing solely exterior recordings.
- For researchers, the launched code helps reproducible neuroscience. A lab may retrain the pipeline by itself MEG dataset.
- For AI engineers, the mission is a template for biosignal decoding. The convolutional-encoder-plus-transformer sample transfers to different biosignal duties.
- For knowledge scientists, the log-linear scaling result’s a planning software. It frames how a lot new recording knowledge could elevate accuracy.
Interactive Explainer
// —- accuracy mannequin (maps gadget + knowledge hours -> goal phrase accuracy) —-
// MEG v2 at 10h ~ 0.61 avg; log-linear in knowledge; EEG far decrease (prior strategies ~0.08).
operate targetAccuracy(){
var h=+dataEl.worth, frac=Math.log(h)/Math.log(10); // 0..1 throughout 1..10h
if(gadget===’meg’){
var lo=0.18, hello=0.61; // 1h ground -> 10h reported avg
return lo+(hi-lo)*frac;
}else{
var elo=0.05, ehi=0.22; // EEG stays low; ~prior non-invasive band
return elo+(ehi-elo)*frac;
}
}
// —- helpers: corrupt characters, then “LM snap” to phrases —-
operate corruptChars(s,charErr){
var keys=”abcdefghijklmnopqrstuvwxyz”;
return s.break up(”).map(operate(ch){
if(ch===’ ‘)return ‘ ‘;
if(Math.random()
return ch;
}).be part of(”);
}
// word-level edit distance (Levenshtein on tokens)
operate werWords(ref,hyp){
var a=ref.break up(/s+/),b=hyp.break up(/s+/),n=a.size,m=b.size;
var d=[];for(var i=0;i<=n;i++){d[i]=[i];}
for(var j=0;j<=m;j++){d[0][j]=j;}
for(i=1;i<=n;i++)for(j=1;j<=m;j++){
var c=a[i-1]===b[j-1]?0:1;
d[i][j]=Math.min(d[i-1][j]+1,d[i][j-1]+1,d[i-1][j-1]+c);
}
return {dist:d[n][m],n:n};
}
// produce a decoded speculation at a given word-accuracy by swapping some phrases
var SWAPS={the:’they’,assembly:’which means’,scheduled:’schedule’,tomorrow:’tomorow’,
afternoon:’aftermoon’,please:’happy’,carry:’brings’,paperwork:’doc’,
workplace:’workplaces’,would:’may’,like:’preferred’,glass:’class’,chilly:’gold’,water:’waiter’,
prepare:’rain’,leaves:’leaved’,station:’stations’,9:’mine’,studying:’main’,
e book:’look’,backyard:’harden’,she:’see’,is:’in’,my:’by’,to:’too’,for:’far’,of:’on’,at:’as’,a:’as’,i:’a’};
// corrupt precisely ok swappable phrases (ok pushed by goal accuracy) for secure metrics
operate decodeWords(s,wordAcc){
var phrases=s.break up(‘ ‘);
var idx=[];phrases.forEach(operate(w,i){if(SWAPS[w])idx.push(i);});
var nBad=Math.spherical((1-wordAcc)*phrases.size);
nBad=Math.max(0,Math.min(nBad,idx.size));
// shuffle swappable indices, take first nBad
for(var i=idx.length-1;i>0;i–){var j=Math.ground(Math.random()*(i+1));var t=idx[i];idx[i]=idx[j];idx[j]=t;}
var unhealthy={};idx.slice(0,nBad).forEach(operate(i){unhealthy[i]=1;});
return phrases.map(operate(w,i){
if(unhealthy[i])return {w:SWAPS[w],okay:false};
return {w:w,okay:true};
});
}
// —- scope animation —-
operate drawScope(progress,noise){
var W=canvas.width,H=canvas.top;ctx.clearRect(0,0,W,H);
ctx.lineWidth=1.6;
for(var lane=0;lane<3;lane++){
ctx.beginPath();
var base=H*(0.32+lane*0.2), amp=12-lane*2, col=[‘#5fd0de’,’#8fe0ea’,’#3fb9c9′][lane];
ctx.strokeStyle=col;ctx.globalAlpha=0.5+lane*0.12;
for(var x=0;x<=W;x+=4){
var p=x/W, on=p
operate end(wordAcc,sentence){
levels.forEach(operate(s){s.classList.take away(‘lively’);s.classList.add(‘accomplished’);});
slab.textContent=”sentence recovered”;
// construct LM-corrected output
var dec=decodeWords(sentence,wordAcc);
finalEl.innerHTML=dec.map(operate(o){
return ‘‘+o.w+’‘;
}).be part of(‘ ‘);
var hyp=dec.map(operate(o){return o.w;}).be part of(‘ ‘);
var w=werWords(sentence,hyp);
// displayed accuracy tracks the modeled goal (secure), with gentle jitter
var acc=Math.spherical(wordAcc*100 + (Math.random()*4-2));
acc=Math.max(0,Math.min(100,acc));
var werPct=100-acc;
animateNumber(accEl,0,acc,’%’,900,operate(){
accBar.fashion.width=acc+’%’;
});
animateNumber(werEl,0,werPct,’%’,900,operate(){werBar.fashion.width=werPct+’%’;});
// contextual observe
var observe=doc.getElementById(‘b2qNote’);
if(gadget===’eeg’){
observe.innerHTML=’EEG path: electric-field recordings are noisier, so accuracy stays low — near the ~8% band reported for prior non-invasive strategies.’;
}else if(+dataEl.worth<10){
observe.innerHTML=’Knowledge scaling: at ‘+dataEl.worth+’ h the mannequin trails its ceiling. Accuracy climbs log-linearly towards the reported 61% common at 10 h.’;
}else{
observe.innerHTML=’MEG v2 · full knowledge: this lands close to the reported 61% common phrase accuracy. Meta’s greatest participant reached 78%, decoding over half of sentences with one phrase error or much less.’;
}
busy=false;runBtn.classList.take away(‘busy’);runBtn.disabled=false;runTxt.textContent=”Decode once more”;
postHeight();
}
}
runBtn.addEventListener(‘click on’,run);
// idle scope shimmer
(operate idle(){
if(!busy){var W=canvas.width,H=canvas.top;ctx.clearRect(0,0,W,H);
ctx.strokeStyle=”rgba(95,208,222,.25)”;ctx.lineWidth=1.4;ctx.beginPath();
for(var x=0;x<=W;x+=6){var y=H*0.5+Math.sin(x*0.03+efficiency.now()*0.0014)*5;
if(x===0)ctx.moveTo(x,y);else ctx.lineTo(x,y);}ctx.stroke();}
requestAnimationFrame(idle);
})();
setTimeout(postHeight,400);
})();
