{"about":{"site":"https://codewithpapers.app","non_affiliation":"Code with Papers and Syntology are not affiliated with, endorsed by, or sponsored by Papers with Code, Meta, or the pwc-archive mirror.","licence":"CC BY-SA 4.0","licence_url":"https://creativecommons.org/licenses/by-sa/4.0/legalcode","attribution":"https://codewithpapers.app/attribution","modified":"archive material modified by Syntology; see the attribution page"},"url":"/paper/ocd-learning-to-overfit-with-conditional","title":"OCD: Learning to Overfit with Conditional Diffusion Models","arxiv_id":"2210.00471","date":"2022-10-02","proceeding":null,"authors":["Shahar Lutati","Lior Wolf"],"abstract":"We present a dynamic model in which the weights are conditioned on an input sample x and are learned to match those that would be obtained by finetuning a base model on x and its label y. This mapping between an input sample and network weights is approximated by a denoising diffusion model. The diffusion model we employ focuses on modifying a single layer of the base model and is conditioned on the input, activations, and output of this layer. Since the diffusion model is stochastic in nature, multiple initializations generate different networks, forming an ensemble, which leads to further improvements. Our experiments demonstrate the wide applicability of the method for image classification, 3D reconstruction, tabular data, speech separation, and natural language processing. Our code is available at https://github.com/ShaharLutatiPersonal/OCD","url_abs":"https://arxiv.org/abs/2210.00471v5","url_pdf":"https://arxiv.org/pdf/2210.00471v5.pdf","source":{"archive":"pwc-archive (Hugging Face), CC BY-SA 4.0","snapshot":"2025-07-28","licence_url":"https://creativecommons.org/licenses/by-sa/4.0/legalcode","row_kind":"abstracts"},"code_links":[{"paper_slug":"ocd-learning-to-overfit-with-conditional","repo_url":"https://github.com/shaharlutatipersonal/ocd","is_official":1,"mentioned_in_paper":1,"mentioned_in_github":1,"framework":"pytorch","reach":null}],"tasks":[{"task_slug":"3d-reconstruction","task_name":"3D Reconstruction"},{"task_slug":"denoising","task_name":"Denoising"},{"task_slug":"few-shot-text-classification","task_name":"Few-Shot Text Classification"},{"task_slug":"image-classification","task_name":"Image Classification"},{"task_slug":"speech-separation","task_name":"Speech Separation"},{"task_slug":"image-classification","task_name":"image-classification"}],"methods":[{"method_slug":"base","method_name":"BASE"},{"method_slug":"diffusion","method_name":"Diffusion"},{"method_slug":"ocd","method_name":"OCD"}],"datasets_introduced":[],"methods_introduced":[{"slug":"ocd","name":"OCD","full_name":"Overfitting Conditional Diffusion Model"}],"results":[{"leaderboard":"/sota/few-shot-text-classification-on-amazon","task":"Few-Shot Text Classification","dataset":"Amazon Counterfeit","model":"SetFit + OCD","rank_in_archive_order":1,"of":1,"metrics":{"Accuracy":"0.41"},"uses_additional_data":false},{"leaderboard":"/sota/few-shot-text-classification-on-average-on","task":"Few-Shot Text Classification","dataset":"Average on NLP datasets","model":"SetFit + OCD(5)","rank_in_archive_order":1,"of":4,"metrics":{"Accuracy":"0.648"},"uses_additional_data":false},{"leaderboard":"/sota/few-shot-text-classification-on-average-on","task":"Few-Shot Text Classification","dataset":"Average on NLP datasets","model":"SetFit + OCD","rank_in_archive_order":2,"of":4,"metrics":{"Accuracy":"0.643"},"uses_additional_data":false},{"leaderboard":"/sota/few-shot-text-classification-on-average-on","task":"Few-Shot Text Classification","dataset":"Average on NLP datasets","model":"T-few 3B","rank_in_archive_order":3,"of":4,"metrics":{"Accuracy":"0.633"},"uses_additional_data":false},{"leaderboard":"/sota/few-shot-text-classification-on-average-on","task":"Few-Shot Text Classification","dataset":"Average on NLP datasets","model":"SetFit","rank_in_archive_order":4,"of":4,"metrics":{"Accuracy":"0.622"},"uses_additional_data":false},{"leaderboard":"/sota/few-shot-text-classification-on-sst-5","task":"Few-Shot Text Classification","dataset":"SST-5","model":"SetFit + OCD","rank_in_archive_order":1,"of":1,"metrics":{"Accuracy":"0.478"},"uses_additional_data":false},{"leaderboard":"/sota/image-classification-on-tiny-imagenet-1","task":"Image Classification","dataset":"Tiny ImageNet Classification","model":"DeiT-B/16-D + OCD(5)","rank_in_archive_order":2,"of":23,"metrics":{"Validation Acc":"92.0%"},"uses_additional_data":false},{"leaderboard":"/sota/image-classification-on-tiny-imagenet-1","task":"Image Classification","dataset":"Tiny ImageNet Classification","model":"DeiT-B/16-D + OCD","rank_in_archive_order":6,"of":23,"metrics":{"Validation Acc":"90.8%"},"uses_additional_data":false},{"leaderboard":"/sota/speech-separation-on-libri5mix","task":"Speech Separation","dataset":"Libri5Mix","model":"OCD","rank_in_archive_order":3,"of":4,"metrics":{"SI-SDRi":"13.4"},"uses_additional_data":false}],"syntology":{"atlas_url":"https://app.syntology.ai/?focus=2210.00471","mcp":{"get_harvested_code_for_paper":{"arxiv_id":"2210.00471"}},"developers":"https://syntology.ai/developers","read_at":"2026-09-24T18:15:14+00:00","read_at_is":"when the build read Syntology's graph, not when any sample ran","claim":"Per-sample execution status on synthesized fixtures; not a correctness claim about the paper. Samples come from repositories linked to the paper, official or community; repo_kind says which.","repos":[{"provenance":"external:paperswithcode_snapshot_2025-07-28","url":"https://github.com/shaharlutatipersonal/ocd","reach":null}],"summary":{"unverified":2},"by_repo_kind":{"official":{"samples":2,"ran":0,"repositories":1}},"repo_kind_vocabulary":{"official":"The archive marks this repository official for the paper","named_in_paper":"The archive records that the paper mentions this repository; it is not marked official","listed":"In the archive's code links for this paper, not marked official and not recorded as mentioned in the paper","found_in_text":"Syntology found this repository in the paper's own text; whether it is the authors' implementation is not asserted","community":"Not in the archive's code links for this paper; a community repository Syntology harvested"},"n_pointer_only_for_licence":0,"samples":[{"code_sha256_prefix":"aaf3ae2fadf84491","entry":"Model","repo":"shaharlutatipersonal/ocd","repo_kind":"official","path":"diffusion_ocd.py","file_url":"https://github.com/shaharlutatipersonal/ocd/blob/HEAD/diffusion_ocd.py","link_basis":"first_harvest_node","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"aaf3ae2fadf84491"}},{"code_sha256_prefix":"8f7496e42e7438c2","entry":"ResnetBlock","repo":"shaharlutatipersonal/ocd","repo_kind":"official","path":"diffusion_ocd.py","file_url":"https://github.com/shaharlutatipersonal/ocd/blob/HEAD/diffusion_ocd.py","link_basis":"first_harvest_node","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"8f7496e42e7438c2"}}]},"arxiv_metadata":null,"syntology_extracted_results":null}