Questions on training hyperparameters and discrepancy between my test results and reported statistics
Hi, thank you for releasing the code and weights for this excellent work. I recently trained the model from scratch (SFT only) and tested it on your train, val, test splits, 500 samples each. but I ran into a couple of issues I’d like to clarify:
1. Training epochs and validation loss
In the code, the number of training epochs is set to 150. During my training, the training loss decreases steadily across all epochs. However, the validation loss reaches its minimum around epoch 18 and then starts to increase afterwards:
- Could this be considered a sign of overfitting?
- For your released best weight, how many epochs was the SFT stage trained for? Did you also observe a similar increase in validation loss?
2. Test results vs. reported numbers
When evaluating both my trained checkpoints and your released weight, I found that the test results are much better than those reported in the paper as shown in the following image. The column names refer to models:
checkpoint-best: best model at epoch 125 (SFT training)checkpoint-last: final model at epoch 150 (SFT training)release-weight: your released model
For the released weight, the results on the test split are:
- OOB = 0.018
- MBL = 0.007
- VBL = 0.024
- PMS = 0.91
But in the paper, the reported values are:
- OOB = 0.160
- MBL = 0.181
- VBL = 0.341
- PMS = 0.71
I did not modify the code, and for testing I simply passed the released weight path via the --test_ckpt parameter.
Could you clarify why there is such a large discrepancy between the reported results and what I obtained?
Thank you in advance for your help!
Hi @Infinity12306, thanks for checking out our work and the nice words!
These are indeed interesting findings. For now, I'll try to answer your questions as follows:
(1) The overfitting you observe is expected. I assume that you have plotted the standard loss in your comparison figure, which, for SFT, should be the next-token prediction loss as Cross Entropy (CE) loss. While overfitting on the training tokens already happens "early", as you confirm, we observed that for our metric of interest, i.e. lowest "delta VBL", it was worth to train a little bit longer than purely via lowest validation token loss, and save the best model based on lowest delta VBL. If you have the compute to re-run your experiments, it will be worth to also plot the "delta VBL" metric for every epoch (or every 5 epochs if you don't wanna run inference after every epoch), so you can observe how VBL performs. Overall, VBL seemed a bit sensitive to sampling during inference, and thus there is a bit of variance in that regard. You should be able to verify that the best model saved is indeed not the one with lowest validation loss. Please report back if that is not the case.
(2) Given the explanation above in (1), I am not sure how you picked your "checkpoint-best". If you did not modify our code base, which you mention, this should be based on "lowest VBL" as explained above. However, given your numbers, this is indeed very interesting. One thing for sure is that, for the numbers in the paper (which come from Table 2; last block), we report the SFT+GRPO model, not the SFT-only model, which you are using. This will explain some difference at least. However, since the gap is very large, and your SFT model seems to outperform our reported SFT+GRPO model on all metrics of interest, I am now a bit confused as well.
What test split did you use for this comparison? Did you correctly use "all" ? Can you give me the full command you used for running the eval script? You might have been using Best-of-N=8 for your SFT case, while we report BoN=1. We have put BoN=8 as default in the script (I see just now), since our ablation shows substantially better performance. However, due to unfair comparison with baselines, we have not used this for Table 2. This might not be fully clear from the paper or the eval script!
There are also flags "--do-bedroom-testset" and "--do-livingroom-testset" which might enable bedroom or livingroom test sets, which will make a difference. I suppose this, and a BoN=8 setting might already explain the performance gap.
Basically, if you set "BON_LLM=1" in the eval script and run again (this will take a while as you already might know), the gap could be closed. However, ideally, you should still see different numbers, since you have only an SFT model, not an SFT+GRPO one. For comparison, here are the differences between SFT (first one; should match your model) and SFT+GRPO (second one) for the "all" test split:
| Method | ↓ FID | ↓ FIDCLIP | ↓ KID×1e3 | ↓ OOB×1e3 | ↓ MBL×1e3 | ↓ VBL×1e3 | ↑ PMS |
|---|---|---|---|---|---|---|---|
| ReSpace/A | 43.49±.1 | 2.18±.1 | 1.52±.2 | 219.4±11.2 | 147.2±4.7 | 366.6±11.6 | 0.74±.0 |
| ReSpace/A† | 44.85±.2 | 2.43±.2 | 2.44±.5 | 160.2±16.0 | 181.6±26. | 341.8±17.9 | 0.71±.0 |
However, overall, I still expect some minor eval difference, since we have dynamic data augmentation during training. Thus, your trained model will not match 1:1 our SFT model (which we have not released the weights for anyways). However, I hope we can close this gap and fully explain the confusion!
Thanks again for doing all this work!
Thank you very much for your comprehensive and detailed response, and I apologize for the delayed reply.
You mentioned the evaluation script in your response, which made me realize that I haven't been using it at all. This could be the reason behind the differences in our test results. Specifically, the test results in the table were directly taken from the evaluation outputs reported in the training log. However, during my first training, I only ran evaluations starting from epoch 100, with a frequency of every 5 epochs. As a result, the evaluation results for epochs before 100 were missing.
To address this, I reran the first 100 epochs of SFT training, saving checkpoints at epochs 17, 18, and 19 (which have the lowest validation loss), as well as from epoch 25, every 5 epochs. I then ran evaluations on these checkpoints using the following command:
CUDA_VISIBLE_DEVICES=3,4 accelerate launch --multi_gpu --num_processes=2 --num_machines=1 --mixed_precision bf16 --main_process_port 29511 --dynamo_backend=no src/main.py --jid="$EXP_NAME" --run-id="$EXP_NAME" --use-cached-dataset --use-gpu --env=".env" --test-bs=32 --use-logfile --test-ckpt "$CKPT_IDX"
For reference, the training command I used is almost identical to your script, with only a few unimportant arguments like jid and run_id modified for convenience:
CUDA_VISIBLE_DEVICES=4,6 accelerate launch --debug --multi_gpu --num_processes="${N_TASKS}" --num_machines="${JOB_NUM_NODES}" --mixed_precision bf16 --machine_rank="${NODEID}" --main_process_ip="${MASTER_ADDR}" --main_process_port="${MASTER_PORT}" --dynamo_backend=no src/main.py --jid="$EXP_NAME" --run-id="$EXP_NAME" --use-cached-dataset --use-gpu --env=".env" --epochs=150 --test-bs=32 --llm="qwen-2.5-1.5B" --room-type="all" --use-wandb --do-augm --lambda-instr-exp=0.0 --dvc-batch-size=4 --gas-steps=8 --use-logfile
Since neither the training nor evaluation scripts include a do_testset_only argument, the evaluation was applied to all splits (train, validation, and test), with 500 samples each. With the evaluation results from before epoch 100 and the reported results after epoch 100 in the training log, I plotted the VBL loss curve (referred to as pbl in your code) as shown below:
This curve confirms your suggestion that the lowest validation loss doesn't always indicate the best model. It makes sense intuitively, as next-token prediction loss doesn't necessarily correlate directly with actual scene quality.
I also dug deeper into the code and discovered that, since no n-best-of-n-llm argument was provided in my training and evaluation, it defaults to 1, which matches your setting. Based on these additional details, I suspect the differences in our test results could be due to my not using your eval script, but instead relying on the evaluation results reported in the training log. This is the only distinction I can think of between our setups.
Lastly, I just wanted to say that your new avatar is awesome! I’m also a huge fan of skiing, although I’m a snowboarder myself, haha!
Thanks for providing more details! I think I understand now what is going on :)
TLDR; Nothing wrong on your end. I think you have reproduced my results almost 1:1.
First, your plot confirms that the lowest Delta VBL scores indeed happen later during training, i.e. long after we have "overfitted" if only looking at the validation token loss (epochs 17-19). Lowest Delta VBL happens for "val" (which we look at for saving the best checkpoint) at epoch 125
Now, given your training scripts, you do not specify the dataset split explicitly, which leads me to assume that you use "bedroom" (default).
Most importantly, you run evaluation for SINGLE OBJECT ADDITION, thus NOT on full scenes. This means that we need to compare to the results in Table 1 from the main paper, not Table 2.
The numbers for comparison you have put into the first comment in the issue come from Table 2 though. You are thus comparing single object addition with full scenes! This is not good.
For full scenes, you would need to provide the --do-full-scenes flag. However, it's also important to provide other flags that help for performance, such as --do-icl-for-prompt, --do-class-labels-for-prompt, and --do-prop-sampling-for-prompt. Check the evaluation script for this: https://github.com/GradientSpaces/respace/blob/master/src/scripts/eval/respace_eval_full.sh
Now, if we look at Table 1 from the main paper and check the numbers for bedroom (the first block), we have the SFT-only model trained only on bedrooms (denoted as "ReSpace/B"). We have a delta VBL score of 26.89 (1e-3), i.e. 0.02689 there. This matches roughly what you have in the plot at epoch 125 under the green line, since we save the best checkpoint based on lowest delta VBL for "val" (happening at epoch 125), evaluated on the "test" split.
So I think we solved the mystery.
I would recommend to look at the evaluation script for full scene synthesis and run it on your SFT model, so you can see how it performs for full scene generation. However, this will take much longer than only single object addition (many hours).
If anything weird happens, feel free to open another issue and we can look into it! Closing this for now as I think we resolved this.
Also, thanks for the kind words, snowboarding is awesome too !!
Thank you for your detailed explanation. I apologize for the confusion; I was being careless and mistakenly compared my results with the second table, which reports results for full scene synthesis. You are right—my results align almost perfectly with yours in the first table, with only minor, reasonable differences.
Questions on Evaluation Data Used in Training and Eval Script
After reviewing the training code and eval script, I have a few questions and observations regarding the data used.
- During training, the evaluation data consists of 500 samples each from the training, validation, and test sets.
- However, the evaluation script uses data from the
"test_instrs"dictionary within theSSR3DFRONTdataset, which contains $3 \times 500$ samples.
This leads to my main questions:
- Is there any overlap between these two sets of $3 \times 500$ samples?
- Does the
"test_instrs"data correspond to the "heldout $3 \times 500$ test sets" mentioned in your paper's table title?
If so, this would likely explain the slight discrepancy between my evaluation results and yours, as I used the results reported during the training stage, which pulls from the train/val/test data, rather than the "test_instrs" in the SSR3DFRONT dataset.
Finally, I just want to thank again for your quick and generous help, it leaves me a deep impression of how quick and helpful your response is. It is such a wonderful experience using Github Issues for help. And I'm sorry for my late reply, again, I'm such a lazy guy and work not very hard. 🥲
I am glad to hear that this resolved the confusion around the evaluation numbers!
You make a good point about the test splits used. However, I just checked the code and could not find or remember any instance where we're using the HF datasets via "test_instr" dictionary. Is that some code that you added manually afterwards? The only reference to the HF dataset is in the README of the repo, but after checking pipeline.py I see that we still use the splits provided in the pickle files under ./data/... which should be consistent with the results reported in the paper.
Of course, some discrepancy comes from training itself, since the data augmentation creates partial scenes dynamically "on the fly" by shuffling the order of objects, rotating, removing some objects etc. So different runs will never see the exact same samples consistently, since I am not sure that I've set all the seeds etc. correctly. There is also some nondeterminism via floating point arithmetic on CUDA etc. Don't worry about this too much. You can also just pull the weights from HF that we provide if you wanna be sure to have the exact same SFT model.
No worries at all. I'm very glad we have a conversation going since that shows interest in our work, which is very exciting for me! You've already got very far with reproducing the SFT results etc. Amazing job!
Thank you for your kind words! I apologize for not providing the full context about test_instrs.
To clarify, test_instrs is a key within the .pkl files in the SSR3DFRONT dataset. Additionally, I believe the dataset cache file used in pipeline.py seems to be from the SSR3DFRONT dataset rather than the dataset cache file located in ./data/.... You can verify this in line 154 of pipeline.py here, where the get_test_instrs_all function is invoked to prepare the data. Inside the get_test_instrs_all function here, the data is loaded from a .pkl file inside the PTH_STAGE_3 directory, which is located in ./dataset-ssr3dfront/splits—i.e., the path to your SSR3DFRONT dataset.
During the evaluation stage of training, the object addition prompt data is prepared through the prepare_batch function, which you can find in line 487 of test.py here. This function manually creates prompts on the fly for the training and validation splits. For the test split, it works similarly to pipeline.py and retrieves the first prompt given the scene jid from the test_instrs dictionary within the .pkl file in the SSR3DFRONT dataset.
This is why I mentioned that the data used during the evaluation stage in training differs slightly from the data used in the evaluation script (i.e., in pipeline.py). In pipeline.py, all 3x500 samples are sourced from the test_instrs dictionary within the .pkl file of your SSR3DFRONT dataset. However, during the evaluation stage in training, only the 500 samples for the test split are taken from the test_instrs dictionary, while the other 2x500 samples for the train and validation splits are generated on the fly.
Hi @Infinity12306, yes you are correct!
If i recall correctly, both the eval script and test.py load the test split from get_test_instrs_all, with the only difference that for test.py, we hardcode the random seed via 1234, and thus only pick 1x500 (similarly, for train and val only 1x500 but we dynamically generate the samples), see L191 in test.py here
For the eval script, we load all 3 seeds from the pickle file (instead of only 1234).
To answer your questions above then:
"Is there any overlap between these two sets of 3×500 samples?" and "Does the "test_instrs" data correspond to the "heldout 3×500 test sets" mentioned in your paper's table title?"
For test.py, we have 1x500 for train, 1x500 for val, and 1x500 for test. For train and val, we generate them dynamically, for val we take the first set with seed 1234 from the fixed 3x500 test set with 3 different random splits. For the eval script, we take only 3x500 from the fixed test set though. For your second question, yes, the "test_instrs" data does correspond to the heldout 3x500 test set and should reproduce the numbers in Table 1.
Does that clarify the confusion?
Yes, this completely clears up all my confusion and questions. Thank you for your detailed explanation! I think it's fine to close the issue now.
awesome, thanks!