Qwen3 dataset - how is the input/target split handled? #2640
csanadpoda
started this conversation in
General
Replies: 1 comment
|
Also confused. |
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
I'm trying to fine tune Qwen3 using a custom loss function, and I can't figure out how it works. I follow the colab for non-thinking training, I have the correct dataset. I can even train on my custom dataset just fine. However I wanted to dig deeper into how it works, so I created a dummy custom loss function to see what's in the inputs, what's in the labels and the target. An example from my dataset, train_ds[0]:
{'text': '<|im_start|>user\nYou are part of an AI system helping to clear up broken Hungarian TTS data that outputs everything phonetically. Correct all incoming text, but return only the corrected text. If you add anything other than the cleaned text, it will break the system. Do not write a program for it, you handle it yourself. Use the correct punctuation instead of the phonetic transcriptions. For example, correct "paragrafus" to "§" and so on Numbers should appear as numerals. Dates should be displayed in Hungarian format. Names should start with a capital letter. Do not add new words. Do not change the order of the words. Do not translate the text, return it in Hungarian, only de-phonetize it!\n\nInput: utalt arra vallomásában jé ká véd tizedik oldal hogy volt egy számla amire a egyéb érdekelt negyvenöt nem állította ki az igazolást és megállított további hitelek folyósítása miatt e körben elmondta hogy volt egy egyeztetés a egyéb érdekelt negyvenöt munkatársával személyesen az egyéb érdekelt hét nél hiszen kialakult egy pánikhangulat mert egy olyan rizikóval nem számolt a bank amivel igazából ő sem számolt hogy ilyen megtörténhetett<|im_end|>\n<|im_start|>assistant\n<think>\n\n</think>\n\nUtalt arra vallomásában (Jkv. 10. oldal), hogy volt egy számla, amire a egyéb érdekelt45 nem állította ki az igazolást és megállított további hitelek folyósítása miatt. E körben elmondta, hogy volt egy egyeztetés a egyéb érdekelt45 munkatársával személyesen az egyéb érdekelt7-nél, hiszen kialakult egy pánikhangulat, mert egy olyan rizikóval nem számolt a bank, amivel igazából ő sem számolt, hogy ilyen megtörténhetett.<|im_end|>\n'}I'm loading the and preparing the model as described in the guide, but I add a custom loss:
So basically all I'm doing is printing the input ids and the labels.
What I can't understand is WHY is there NOTHING in my "PROMPT" output? The whole input seems to be kept in the TARGET part. How does Qwen3 differentiate between the target and the prompt while learning?
An example output for this code is:
All reactions