Minimal by Training: data-minimizing tool-calling adapter (Tiny Aya Global)

A LoRA adapter for CohereLabs/tiny-aya-global (3.35B). It was fine-tuned with AgentTune so that a tool-calling agent puts only the fields a task needs into its tool-call arguments, and leaves out unneeded personal data such as addresses and phone numbers. It is the ft_minimal arm of a study for the Lexsi AI Safety and Alignment Hackathon, Track 3 (Agentic Fine-tuning).

This is a research artifact. It was trained on a synthetic dataset with 9 tools and tested on those tools plus 2 held-out ones. It is not a privacy guarantee and should not be used to protect real personal data.

Results

Scored with AuditKIT on synthetic personas. "Clean success" means the task is done correctly and no unneeded personal field appears in the tool call.

Split Base clean success This adapter Base leak rate This adapter
test_id (200, unseen phrasing, same tools) 67.0% 90.5% 24.5% 3.0%
test_ood (100, two held-out tools) 72.0% 88.0% 11.0% 5.0%

On the held-out tools the drop in leaks is not statistically significant, and all 5 remaining leaks were calls to the wrong tool. Tool accuracy on that split fell from 99% to 95%.

The leak detector is a string match against a synthetic persona. It misses paraphrased leaks and can flag harmless text, so the leak rates are lower bounds.

Training

  • Method: LoRA (r=16, alpha=32, dropout 0.05) on q_proj, k_proj, v_proj, o_proj, trained with AgentTune 1.1.6 (PEFT 0.21.2)
  • Data: 600 synthetic demonstrations in which every tool call contains only the needed fields (leak_frac 0.0)
  • Settings: 3 epochs, learning rate 2e-4, batch size 1 with gradient accumulation 16, max length 1536, seed 7
  • Result: final training loss 0.48, about 27 minutes on one Colab L4 GPU

How to use

Load the adapter on the base model, then merge it. The base model is gated, so accept its terms on Hugging Face first.

import torch
from transformers import AutoTokenizer
from peft import AutoPeftModelForCausalLM

adapter = "Mango-1864/minimal-by-training-adapter"
tok = AutoTokenizer.from_pretrained(adapter)
model = AutoPeftModelForCausalLM.from_pretrained(
    adapter, dtype=torch.bfloat16, device_map="cuda"
).merge_and_unload()

# Important: set both stop tokens, or the model keeps generating after it finishes.
model.generation_config.eos_token_id = [
    tok.convert_tokens_to_ids("<EOS_TOKEN>"),
    tok.convert_tokens_to_ids("<|END_OF_TURN_TOKEN|>"),
]

Without the stop-token step, the fine-tuned model emits <|END_RESPONSE|><|END_OF_TURN_TOKEN|> and then continues until the token limit. The repo's merge_fix.py does this step.

Limitations

  • Synthetic data, one base model, one training seed. 9 tools for training and in-distribution testing, 2 more held out.
  • Not tested on real personal data, other languages or tools beyond these.
  • A privacy rule in the prompt alone did not help in this study: leaks went up from 24.5% to 42.5% on test_id.

Licence

The adapter inherits the base model's licence, CC-BY-NC-4.0, and Cohere's acceptable use policy. Non-commercial use only.

Links

Downloads last month
22
Inference Providers NEW
This model isn't deployed by any Inference Provider. ๐Ÿ™‹ Ask for provider support

Model tree for Mango-1864/minimal-by-training-adapter

Adapter
(455)
this model

Collection including Mango-1864/minimal-by-training-adapter