CoolFace
Modelpublic

BananaMind/BananaMind-2-assistant2user

sourceHugging Faceapache-2.0updated 1d agoView on Hugging Face
2likes599downloads
Model Card

BananaMind 2 Assistant2User

[image] 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:

text
User message
↓
Assistant response

Training direction:

text
Assistant response
↓
Reconstructed user message

The model receives the assistant response as context and predicts the user message that likely caused that response.

Example

Input:

text
Assistant answer:
The capital of Japan is Tokyo.

Reconstruct the user message:

Output:

text
What is the capital of Japan?

Training

The original Smol-SmolTalk conversations contain messages in the usual structure:

text
user → assistant

Every adjacent user and assistant pair was converted into an independent reversed training example.

For example:

text
user:
How do I reverse a Python list?

assistant:
You can reverse a Python list with list.reverse() or slicing with [::-1].

becomes:

text
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

SettingValue
Base modelBananaMind-2-Pro
Parameters138,971,520
Fine-tuningFull parameter
DatasetHuggingFaceTB/smol-smoltalk
Context length3,072
PrecisionBF16
Learning rate5e-5
Micro batch size8
Gradient accumulation4
Effective batch size32
Epochs1

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.

MetricScore
Token Top-1 Accuracy24.617%
Token Difference75.383%
Token F138.189%
Exact Sequence Accuracy1.200%

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.

text
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:

text
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:

text
The capital of Japan is Tokyo.

Reconstructed user message:

text
What is the capital of Japan?

Yes or no question

Assistant response:

text
No, 17 is not an even number.

Reconstructed user message:

text
Is 17 an even number?

Programming question

Assistant response:

text
To reverse a Python list, you can use list.reverse() or slicing with [::-1].

Reconstructed user message:

text
Write a Python program that reverses a list of integers.

Installation question

Assistant response:

text
You can install PyTorch with pip using pip install torch.

Reconstructed user message:

text
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:

text
A binary search runs in O(log n) time on a sorted array.

Reconstructed user message:

text
What is the time complexity of a binary search?

Long-answer reconstruction

Assistant response:

text
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:

text
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

python
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:

text
What is the capital of Japan?

What the model learns

Assistant-to-user reconstruction is inherently underdetermined.

An assistant response such as:

text
The color of the sky is blue.

could reasonably come from many prompts:

text
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:

text
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.

Base model

BananaMind/BananaMind-2-Pro

Dataset

HuggingFaceTB/smol-smoltalk