Chinese Academy of Sciences' Neural Gate Stops Vision AI From Leaking Passport Numbers
Neural Gate uses neuron-level gradient truncation to teach vision-language models to refuse privacy-sensitive prompts without breaking their normal task performance.
ProTakeaways
- Neural Gate edits privacy-related neurons in LVLMs so they refuse sensitive queries without hurting benign task performance.
- Privacy neurons are sparse: less than 10 percent of dimensions consistently drive refusal behavior across samples.
- Method truncates gradients on non-privacy neurons during FFN editing, preserving irrelevant capabilities.
- Reaches 0.9610 safety on LLaVA PrivacyPair-test and 0.7522 on out-of-distribution MLLMGuard.
- Introduces PrivacyPair, paired sensitive and benign queries across passports, IDs, phone numbers, receipts, military, and government documents.
- Code and hyperparameters available at github.com/Xiangkui-Cao/Neural-Gate.
Vision-language models happily read passport numbers, phone numbers on receipts, and student IDs off a photograph when asked. That is a problem for anyone deploying them in finance, healthcare, or consumer apps, and it is the exact behavior that a new method called Neural Gate tries to shut down without turning the model into a useless refusal machine.
The paper, from the Institute of Computing Technology at the Chinese Academy of Sciences, argues that today's privacy defenses for large vision-language models (LVLMs) fall into two frustrating camps. Existing approaches make progress on preventing leakage of sensitive data, but they struggle to robustly handle unseen privacy-related queries and may inadvertently degrade a model's performance on standard tasks. Neural Gate is a question-oriented alternative that edits the model at the neuron level so it learns to refuse sensitive prompts while still answering benign ones about the same object.
Why blanket edits break the model
To understand the fix, the authors first built a diagnostic dataset called PrivacyPair. Each pair contains one privacy-sensitive question and one benign question about the same subject, differing by only a single attribute word. A passport image, for example, spawns a benign query about passport type and a sensitive query about the passport number. Six categories are covered: phone numbers, student IDs, receipts, passports, military equipment, and government documents.
Using this controlled setup, the team probed which neurons in the LLM backbone actually drive refusal behavior. The finding is the crux of the paper: privacy-related neurons in LVLMs exhibit strong cross-sample inconsistency, where only a small subset of neurons consistently contributes to privacy behaviors across different contexts, and neurons that strongly activate for one privacy-sensitive sample often remain inactive for another sample involving the same subject. Strongly active neurons that reliably encode a privacy concept turn out to be less than 10 percent of all feature dimensions.

That sparsity explains why prior methods misbehave. Global unlearning like SKU pushes the entire output distribution away from correct answers and knocks over benign responses in the process. Broad editing methods such as MEMIT and AlphaEdit modify too many neurons and get confused when two queries about the same subject need opposite outcomes.
Gating the gradients
Neural Gate reframes the problem as a masking exercise on the backward pass. For each transformer layer, the authors learn a per-sample vector that scales the subject's feature representation between minus one and one, and use two losses: one that steers sensitive prompts toward a refusal prefix, and one that keeps benign responses unchanged. Dimensions where the learned scale flips negative are flagged as privacy-relevant.
Aggregated across samples, this produces a binary gate for each layer. During actual editing of the FFN down-projection weights, gradients from non-privacy tokens flow normally, but gradients on the privacy subject tokens are truncated to only the strongly active neurons, defined as those flipping negative in more than 30 percent of samples. In practice they edit a single layer, layer 6 for MiniGPT-4 and layer 11 for LLaVA-1.5, with the code editing model.layers.{}.mlp.down_proj.

What the numbers say
Across MiniGPT-4-LLaMA2-7B and LLaVA-1.5-7B, Neural Gate posts the best safety scores while keeping utility close to the untouched baseline. Highlights from the reported evaluations:
- On LLaVA, the refusal-oriented EtA score on PrivacyPair-test rises to 0.9610, and refusal rate on the out-of-distribution MLLMGuard benchmark hits 0.7522, up from a 0.3669 baseline.
- On MiniGPT, the safety average reaches 0.8918 versus DINM's 0.8417 and the untouched 0.4796.
- Utility on ScienceQA, MME, and POPE stays within a fraction of a point of the original model, while unlearning baseline MemFlex* collapses to a 0.2649 utility average on MiniGPT.
- A keyword-based guardrail trained on the same data only refuses 17.43 percent of MLLMGuard queries, versus over 75 percent for Neural Gate, suggesting the model is learning transferable privacy concepts rather than surface keywords.
Where it still slips
Generalization is uneven. The case study shows the edited model correctly refusing trade-secret questions it never saw in training, likely because those overlap conceptually with government documents. But queries about drones can still slip through, because some unseen privacy types are not adequately captured by the learned representations. Multi-layer editing also helps LLaVA but slightly hurts MiniGPT, which the authors attribute to volatile neuron counts across adjacent layers in that architecture.

Trying it out
The code is public on GitHub, and it is aimed squarely at reproducibility rather than package convenience. The main reproducibility path is through experiments/, not through standalone package entry points. You supply your own LLaVA-1.5-7B and MiniGPT-4 checkpoints, edit paths in globals.yml, and tune hyperparameters in hparams/Ours/, where fields like layers, num_steps, and kl_factor control which transformer layer gets rewritten and how aggressively.
For teams shipping vision-language features that touch identity documents, receipts, or regulated content, Neural Gate is a lightweight retrofit worth benchmarking. It runs on a single RTX 4090 for MiniGPT and five for LLaVA, edits one MLP down-projection, and leaves the vast majority of the network alone. That last property, more than any single safety number, is what makes neuron-level gating an interesting direction for privacy alignment.