{"id":19646608,"url":"https://github.com/amzn/extremely-efficient-query-encoder","last_synced_at":"2025-04-30T14:26:27.999Z","repository":{"id":230011512,"uuid":"773771330","full_name":"amzn/extremely-efficient-query-encoder","owner":"amzn","description":"efficient query encoding for dense retrieval ","archived":false,"fork":false,"pushed_at":"2024-08-05T23:43:00.000Z","size":70,"stargazers_count":11,"open_issues_count":1,"forks_count":2,"subscribers_count":3,"default_branch":"main","last_synced_at":"2025-04-30T14:26:21.579Z","etag":null,"topics":["dense-retrieval","information-retrieval","query-encoding"],"latest_commit_sha":null,"homepage":"https://www.amazon.science/publications/extremely-efficient-online-query-encoding-for-dense-retrieval","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/amzn.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-03-18T11:21:08.000Z","updated_at":"2024-06-28T08:59:40.000Z","dependencies_parsed_at":"2025-01-10T11:13:47.182Z","dependency_job_id":null,"html_url":"https://github.com/amzn/extremely-efficient-query-encoder","commit_stats":null,"previous_names":["amzn/extremely-efficient-query-encoder"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/amzn%2Fextremely-efficient-query-encoder","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/amzn%2Fextremely-efficient-query-encoder/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/amzn%2Fextremely-efficient-query-encoder/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/amzn%2Fextremely-efficient-query-encoder/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/amzn","download_url":"https://codeload.github.com/amzn/extremely-efficient-query-encoder/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":251720999,"owners_count":21632753,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["dense-retrieval","information-retrieval","query-encoding"],"created_at":"2024-11-11T14:39:28.334Z","updated_at":"2025-04-30T14:26:27.968Z","avatar_url":"https://github.com/amzn.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"extremely-efficient-online-query-encoding-for-dense-retrieval is an extension of the popular \n[Tevatron package](https://github.com/texttron/tevatron/) \n([commit](https://github.com/texttron/tevatron/commit/b8f33900895930f9886012580e85464a5c1f7e9a)),\nadding the ability to use a small query encoder (with a large passage encoder) to have very low encoding time, while \nincurring minor impact in quality. \n\n## Instructions\n\n1. Create (teacher) embeddings for all queries in the train set, using\n   ```bash\n   python -m tevatron.driver.encode --output_dir /tmp/encode --model_name_or_path Luyu/co-condenser-marco --fp16 \\\n   --per_device_eval_batch_size 128 \\\n   --encode_in_path ../resources/pretrain_data/train_queries_tokens.jsonl \\\n   --encoded_save_path ../resources/pretrain_data/train_queries.pt`\n   ```\n2. Run pretraining using `python -m run_pretraining.pretrain`\n3. Run training using `marco_train_pretrained_model.sh`\n4. Evaluate using `full_eval.sh`\n\n## Citations\n\n```\n@article{cohen2024indi,\n  title={Extremely efficient online query encoding for dense retrieval},\n  author={Cohen, Nachshon and Fairstein, Yaron and Kushilevitz, Guy},\n  booktitle={Findings of the Association for Computational Linguistics: NAACL 2024},\n  year={2024}\n}\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Famzn%2Fextremely-efficient-query-encoder","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Famzn%2Fextremely-efficient-query-encoder","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Famzn%2Fextremely-efficient-query-encoder/lists"}