BananaMind/BananaMind-2-assistant2user
BananaMind 2 Assistant2User
BananaMind 2 Assistant2User is a 139M parameter language model trained to reconstruct a likely user message from an assistant response.
The model starts from BananaMind/BananaMind-2-Pro and is fully fine-tuned on reversed conversations from HuggingFaceTB/smol-smoltalk.
Normal conversation direction:
User message
↓
Assistant responseTraining direction:
Assistant response
↓
Reconstructed user messageThe model receives the assistant response as context and predicts the user message that likely caused that response.
Example
Input:
Assistant answer:
The capital of Japan is Tokyo.
Reconstruct the user message:Output:
What is the capital of Japan?Training
The original Smol-SmolTalk conversations contain messages in the usual structure:
user → assistantEvery adjacent user and assistant pair was converted into an independent reversed training example.
For example:
user:
How do I reverse a Python list?
assistant:
You can reverse a Python list with list.reverse() or slicing with [::-1].becomes:
Assistant answer:
You can reverse a Python list with list.reverse() or slicing with [::-1].
Reconstruct the user message:
How do I reverse a Python list?Loss is applied only to the reconstructed user message. The assistant response and reconstruction prefix are masked from the training loss.
Training configuration
Evaluation
The model was evaluated by taking conversations from the Smol-SmolTalk test split, hiding the original user message, giving the model only the assistant response, and comparing the generated reconstruction against the original user message.
The results below are from the first 2500 extracted user-assistant pairs from the test split.
Token Top-1 Accuracy
Token Top-1 Accuracy measures how close the generated token sequence is to the original user message using token-level edit distance.
accuracy = 1 - token_edit_distance / max(reference_tokens, generated_tokens)A score of 100% means the generated user message is token-for-token identical after tokenization.
This metric is strict. Semantically equivalent reconstructions can receive a much lower score when they use different wording.
For example:
Original:
for what is the ml-intern-explorers org made
Reconstruction:
What is the purpose of the ml-intern-explorers Hugging Face org?These messages express essentially the same request while differing substantially at the token level.
Samples
Factual question
Assistant response:
The capital of Japan is Tokyo.Reconstructed user message:
What is the capital of Japan?Yes or no question
Assistant response:
No, 17 is not an even number.Reconstructed user message:
Is 17 an even number?Programming question
Assistant response:
To reverse a Python list, you can use list.reverse() or slicing with [::-1].Reconstructed user message:
Write a Python program that reverses a list of integers.Installation question
Assistant response:
You can install PyTorch with pip using pip install torch.Reconstructed user message:
I am trying to install PyTorch on my machine. I have a Python script that I want to use to run PyTorch. I have tried to install PyTorch using pip, but it doesn't seem to work. Can you help me install PyTorch with pip?Time complexity
Assistant response:
A binary search runs in O(log n) time on a sorted array.Reconstructed user message:
What is the time complexity of a binary search?Long-answer reconstruction
Assistant response:
The `ml-intern-explorers` Hugging Face org appears to have been created mainly as a shared community workspace for people/AI agents experimenting with ML...
Its clearest documented purpose is multi-agent ML collaboration...Reconstructed user message:
What is the purpose of the ml-intern-explorers Hugging Face org?This example was tested on an assistant response from a real ChatGPT conversation rather than Smol-SmolTalk.
Usage
import torch
from transformers import AutoTokenizer, AutoModelForCausalLM
model_id = "BananaMind/BananaMind-2-assistant2user"
tokenizer = AutoTokenizer.from_pretrained(
model_id,
trust_remote_code=True,
)
model = AutoModelForCausalLM.from_pretrained(
model_id,
trust_remote_code=True,
dtype=torch.bfloat16,
).cuda()
model.eval()
assistant_message = """
The capital of Japan is Tokyo.
"""
prompt = (
"Assistant answer:\n"
+ assistant_message.strip()
+ "\n\n"
+ "Reconstruct the user message:\n"
)
inputs = tokenizer(
prompt,
return_tensors="pt",
add_special_tokens=False,
).to("cuda")
with torch.inference_mode():
output = model.generate(
**inputs,
max_new_tokens=256,
do_sample=False,
eos_token_id=tokenizer.eos_token_id,
pad_token_id=tokenizer.eos_token_id,
)
generated = output[0, inputs["input_ids"].shape[1]:]
print(
tokenizer.decode(
generated,
skip_special_tokens=True,
)
)Example output:
What is the capital of Japan?What the model learns
Assistant-to-user reconstruction is inherently underdetermined.
An assistant response such as:
The color of the sky is blue.could reasonably come from many prompts:
What color is the sky?
What is the color of the sky?
Is the sky blue?
What color does the sky normally appear?The model therefore learns to generate a plausible originating user message based on the assistant response and the patterns present in its training data.
Short responses such as:
Yes.provide very little information about the original question. Reconstructions from highly ambiguous responses can contain invented context.
Longer and more informative assistant responses generally provide much stronger signals for reconstruction.
Current limitations
The model has approximately 139M parameters, so generation quality varies substantially across inputs.
Observed failure modes include:
- Copying the assistant response instead of reconstructing a user message
- Generating additional context that was not present in the original prompt
- Recovering the correct topic while choosing a different question type
- Producing long synthetic-style instructions
- Poor reconstruction when the assistant response contains very little information
- Repetition on difficult generations
The model performs especially well on assistant messages where the likely originating request is strongly implied by the answer.
