BasicFinQwen v0.3 Multilingual

Author: Z3NN-AI ยท Base model: Qwen3.5-4B (unsloth/Qwen3.5-4B) ยท Weights: bfloat16 (LoRA merged into the base) ยท License: Apache 2.0

BasicFinQwen is a small (4B) assistant for basic finance and fundamental analysis concepts: valuation ratios, margins, cash flow, balance sheet, cost of capital, bonds, options, portfolio and macro basics.

It works in five languages: Spanish (es-ES), English (en-US), French (fr-FR), German (de-DE) and Portuguese (pt-PT). It answers in the language of the question, or in another one if you ask for it.

For each of 207 finance concepts it learned one fixed, verified definition in each language. These are short cards with the definition, how it is calculated, what it indicates, an example and a caveat. It aims to give that same answer reliably, whatever the wording of the question.

What is new in v0.3

v0.2 v0.3
Concepts with a verified card 149 207
Ways of asking per concept and language 7 ~17 (with article, English name in parentheses, compound questions, "how is it calculated", "how is it used", short form)
"Answer in language X" / switching language mid-chat no yes
Several questions in one message no yes
Says "I don't know that concept" for made-up terms no yes

Evaluation

Greedy decoding. All test questions use wordings that were not seen in training. Results for the final checkpoint:

Test es en fr de pt
Card reproduced exactly, new question templates (of 207) 192 194 190 198 178
Card reproduced exactly, new question forms (of 207) 207 206 206 207 207
  • Question in language X plus "answer in Y": 407 of 414 answers have similarity โ‰ฅ 0.90 to the target-language card.
  • Made-up concepts (invented names that look like real ratios): the model says it does not know them in 89 of 90 cases.
  • Real concepts without a card (Treynor ratio, Black-Scholes, Herfindahl-Hirschman indexโ€ฆ): it does not refuse in 30 of 30 cases. It answers from the base model's knowledge.
  • On a 145-question finance exam written by the author (never trained on), the answer is the matching card in 100 cases (v0.2: 12).

The validation loss decreased steadily over training: 0.113 โ†’ 0.088 โ†’ 0.087 โ†’ 0.085 โ†’ 0.085.

Known limitations

  • Format instructions lose to the card. "In max 20 words" or "in 3 bullet points" often returns the card instead.
  • Concepts without a card are answered by the base model and can contain errors. Example: European vs American options.
  • Unknown companies and tickers. It may invent which company a ticker belongs to instead of saying it does not know.
  • Portuguese is meant to be European Portuguese, but general-chat answers mix in Brazilian forms.
  • Not financial advice. The model is designed to decline stock picks, trading and crypto questions.

Usage

Recommended settings:

  • temperature 0 (greedy)
  • repetition penalty 1.0
  • thinking off (enable_thinking=False)

Sampling and repetition penalties make the model paraphrase the verified cards and introduce errors.

from transformers import AutoModelForImageTextToText, AutoTokenizer

repo = "Z3NN001/BasicFinQwen-v0.3-Multilingual"
tok = AutoTokenizer.from_pretrained(repo)
model = AutoModelForImageTextToText.from_pretrained(repo, dtype="bfloat16", device_map="auto")

msgs = [{"role": "user", "content": "Was ist das KGV und wie interpretiert man es?"}]
inputs = tok.apply_chat_template(msgs, add_generation_prompt=True, enable_thinking=False,
                                 return_tensors="pt", return_dict=True).to(model.device)
out = model.generate(**inputs, max_new_tokens=900, do_sample=False)
print(tok.decode(out[0][inputs["input_ids"].shape[1]:], skip_special_tokens=True))

It also works with vLLM, for example vllm serve Z3NN001/BasicFinQwen-v0.3-Multilingual --max-model-len 4096. In bf16 it needs about 10 GB of GPU memory.

Training

  • Data: a private synthetic dataset of about 27,000 conversations (โ‰ˆ12 M tokens). It contains:
    • finance concept cards in 5 languages, each verified against public reference sources;
    • many paraphrased questions for each card;
    • language-switching dialogues;
    • multi-question messages;
    • refusals for made-up concepts;
    • general-chat replay generated by the base model itself, to limit forgetting.
  • Method: LoRA SFT with Unsloth. The loss is computed on the assistant responses only.
    • rank 16, alpha 32, dropout 0, applied to all attention and MLP projections (21.2 M trainable parameters, 0.47 %)
    • 2 epochs, 3,374 steps
    • effective batch 16, max length 8,192 tokens
    • learning rate 2e-4 with a cosine schedule and 20 warmup steps
    • AdamW 8-bit, bf16
  • Hardware: 1ร— NVIDIA A100 PCIe 40 GB, about 3 h 20 min.
  • The LoRA adapter was merged into the base model in bf16.

Versions

  • v0.1: Spanish only. Published as Z3NN001/BasicFinQwen-Spanish-MLX-8bit.
  • v0.2: Multilingual, 149 concepts. Not published.
  • v0.3: Multilingual, 207 concepts. This repository.
Downloads last month
-
Safetensors
Model size
5B params
Tensor type
BF16
ยท
Inference Providers NEW
This model isn't deployed by any Inference Provider. ๐Ÿ™‹ Ask for provider support

Model tree for Z3NN001/BasicFinQwen-v0.3-Multilingual

Finetuned
Qwen/Qwen3.5-4B
Adapter
(261)
this model