Official implementation of "X-CoT: Explainable Text-to-Video Retrieval via LLM-based Chain-of-Thought Reasoning (EMNLP 2025)"
See the codeX-CoT: Explainable Text-to-Video Retrieval via LLM-based Chain-of-Thought Reasoning
This is the official code for the EMNLP 2025 paper "X-CoT: Explainable Text-to-Video Retrieval via LLM-based Chain-of-Thought Reasoning" by Prasanna Reddy Pulakurthi, Jiamian Wang, Majid Rabbani, Sohail Dianat, Raghuveer Rao, and Zhiqiang Tao.
X‑CoT (Explainable Chain‑of‑Thought reranking) takes as input:
It then prompts an LLM to compare pairs of candidate videos against the query, using the breakdowns for grounded, interpretable signals. The pairwise outcomes are aggregated via a lightweight sorting and Bradley‑Terry fit to produce a re‑ranked list with improved recall.
Run in Google Colab
python xcot.py --exp_name=MSRVTT --dataset_name=MSRVTT --topk=20 --topk_retrieval_method=xpool
Download the provided initial retrieval results from the [Hugging Face] link and place them at: outputs/<dataset>/<method>_ranking_<mode>.jsonl
Prepare Datasets:
--videos_dir when generating initial retrievals.Dependencies:
Run the initial retrievers:
See initial_retrievers_cmds.sh for examples of CLI commands.
python xpool_ranking.py --test_mode=benchmark --exp_name=MSRVTT --videos_dir=data/MSRVTT/videos/all --batch_size=32 --huggingface --load_epoch=-1 --dataset_name=MSRVTT --retrieve_topk --topk=20 --topk_retrieval_method=xpool
outputs/<dataset>/model_best.pthoutputs/<dataset>/<method>_ranking_<mode>.jsonl.Clone this repository.
git clone https://github.com/PrasannaPulakurthi/X-CoT.git
cd X-CoT
Python 3.9+, CUDA‑enabled, PyTorch (GPU): https://pytorch.org/get-started/locally/
Example (CUDA 12.x): pip install torch --index-url https://download.pytorch.org/whl/cu121
Install additional packages to run X‑CoT using the following command.
pip install -r requirements.txt
Obtain video breakdowns.
outputs/<dataset>/video_breakdowns_<mode>.jsonlMake sure to have the initial retriever results at outputs/<dataset>/<method>_ranking_<mode>.jsonl by following Step 1.
Run X‑CoT reranking.
python xcot.py --exp_name=MSRVTT --dataset_name=MSRVTT --topk=20 --topk_retrieval_method=xpool
This reads the initial rankings and breakdowns, queries the LLM (default: Qwen/Qwen2.5-7B-Instruct-1M), and logs recall metrics. Logs are written under logs/<exp_name>/<timestamp>/. See xcot_cmds.sh for the full list of CLI commands.
| X-CoT vs CLIP (R@1) | X-CoT vs VLM2Vec (R@1) | X-CoT vs X-Pool (R@1) |
|---|---|---|
![]() | ![]() | ![]() |
If you find this work valuable for your research, we kindly request that you cite the following paper:
@inproceedings{pulakurthi2025x,
title={X-CoT: Explainable Text-to-Video Retrieval via LLM-based Chain-of-Thought Reasoning},
author={Pulakurthi, Prasanna Reddy and Wang, Jiamian and Rabbani, Majid and Dianat, Sohail and Rao, Raghuveer and Tao, Zhiqiang},
booktitle={Proceedings of the 2025 Conference on Empirical Methods in Natural Language Processing},
pages={31172--31183},
year={2025}
}
19 commits
Python
99.3%
Official implementation of "X-CoT: Explainable Text-to-Video Retrieval via LLM-based Chain-of-Thought Reasoning (EMNLP 2025)"
See the codeX-CoT: Explainable Text-to-Video Retrieval via LLM-based Chain-of-Thought Reasoning
This is the official code for the EMNLP 2025 paper "X-CoT: Explainable Text-to-Video Retrieval via LLM-based Chain-of-Thought Reasoning" by Prasanna Reddy Pulakurthi, Jiamian Wang, Majid Rabbani, Sohail Dianat, Raghuveer Rao, and Zhiqiang Tao.
X‑CoT (Explainable Chain‑of‑Thought reranking) takes as input:
It then prompts an LLM to compare pairs of candidate videos against the query, using the breakdowns for grounded, interpretable signals. The pairwise outcomes are aggregated via a lightweight sorting and Bradley‑Terry fit to produce a re‑ranked list with improved recall.
Run in Google Colab
python xcot.py --exp_name=MSRVTT --dataset_name=MSRVTT --topk=20 --topk_retrieval_method=xpool
Download the provided initial retrieval results from the [Hugging Face] link and place them at: outputs/<dataset>/<method>_ranking_<mode>.jsonl
Prepare Datasets:
--videos_dir when generating initial retrievals.Dependencies:
Run the initial retrievers:
See initial_retrievers_cmds.sh for examples of CLI commands.
python xpool_ranking.py --test_mode=benchmark --exp_name=MSRVTT --videos_dir=data/MSRVTT/videos/all --batch_size=32 --huggingface --load_epoch=-1 --dataset_name=MSRVTT --retrieve_topk --topk=20 --topk_retrieval_method=xpool
outputs/<dataset>/model_best.pthoutputs/<dataset>/<method>_ranking_<mode>.jsonl.Clone this repository.
git clone https://github.com/PrasannaPulakurthi/X-CoT.git
cd X-CoT
Python 3.9+, CUDA‑enabled, PyTorch (GPU): https://pytorch.org/get-started/locally/
Example (CUDA 12.x): pip install torch --index-url https://download.pytorch.org/whl/cu121
Install additional packages to run X‑CoT using the following command.
pip install -r requirements.txt
Obtain video breakdowns.
outputs/<dataset>/video_breakdowns_<mode>.jsonlMake sure to have the initial retriever results at outputs/<dataset>/<method>_ranking_<mode>.jsonl by following Step 1.
Run X‑CoT reranking.
python xcot.py --exp_name=MSRVTT --dataset_name=MSRVTT --topk=20 --topk_retrieval_method=xpool
This reads the initial rankings and breakdowns, queries the LLM (default: Qwen/Qwen2.5-7B-Instruct-1M), and logs recall metrics. Logs are written under logs/<exp_name>/<timestamp>/. See xcot_cmds.sh for the full list of CLI commands.
| X-CoT vs CLIP (R@1) | X-CoT vs VLM2Vec (R@1) | X-CoT vs X-Pool (R@1) |
|---|---|---|
![]() | ![]() | ![]() |
If you find this work valuable for your research, we kindly request that you cite the following paper:
@inproceedings{pulakurthi2025x,
title={X-CoT: Explainable Text-to-Video Retrieval via LLM-based Chain-of-Thought Reasoning},
author={Pulakurthi, Prasanna Reddy and Wang, Jiamian and Rabbani, Majid and Dianat, Sohail and Rao, Raghuveer and Tao, Zhiqiang},
booktitle={Proceedings of the 2025 Conference on Empirical Methods in Natural Language Processing},
pages={31172--31183},
year={2025}
}
19 commits
Python
99.3%