Repository files navigation

TimePLE icon

TimePLE: Rethinking Temporal Representation for Video Temporal Grounding

Yuhui Zeng1,4, Xinyu Mao2,4, Xiaokun Liu4, Xin Tao4, Jinfa Huang3, Jiayi Ji1, Xiawu Zheng1

1Xiamen University 2The Chinese University of Hong Kong 3University of Rochester 4Kling Team, Kuaishou Technology

📄 Paper | 🤗 Model | 🗃️ Data

News

  • 2026-07-20: Released the TimePLE codec, Qwen3-VL integration, SFT, data-curation pipeline, and public training configurations.
  • Available: The TimePLE checkpoint, training annotations, benchmark annotations, and inference/evaluation suite are available now.

Overview

Video temporal grounding (VTG) aims to localize the continuous video interval described by a natural-language query. Existing VLM-based methods commonly represent an interval through two endpoint outputs, either as timestamp tokens or continuous boundary coordinates.

TimePLE reformulates VTG as interval-native prediction. It maps every valid temporal interval to a point in a canonical position-duration square and predicts a single joint distribution over this space. A generated <|TIMESPAN|> token provides the latent output interface, while input-side <|TIMESTAMP|> tokens encode the temporal coverage of sampled visual units using the same interval geometry.

video + query
|
| temporal anchors encoded by <|TIMESTAMP|>
v
VLM hidden states
|
| generated <|TIMESPAN|>
v
joint distribution over the canonical position-duration square
|
| expectation decoding + duration-aware residual refinement
v
continuous temporal interval [start, end]

The released codec uses a 128 x 128 canonical grid, Gaussian bandwidth sigma_u = sigma_v = 0.015, and duration-adaptive residual scale alpha = 0.02.

Release Status

ComponentStatusEntry point
TimePLE interval codecsrc/timeple/models
Geometry pretrainingsrc/timeple/geometry_pretrain
Qwen3-VL / Transformers integrationintegrations/transformers
SFT / ms-swift integrationintegrations/ms_swift
GRPO / EasyR1 integrationintegrations/easyr1
Training-data curationdata_pipeline/train_building
Benchmark human-review toolsdata_pipeline/bench_cleaning
TimePLE-8B checkpointKlingTeam/TimePLE
Training and benchmark annotationsKlingTeam/TimePLE-Dataset
Benchmark inference and evaluationevaluation

Quick Navigation

Installation

Clone the repository and enter the project directory:

git clone https://github.com/KlingAIResearch/TimePLE.git
cd TimePLE

TimePLE uses uv to reproduce exact upstream environments. Build the environment required by the stage you want to run:

# Supervised fine-tuning
bash scripts/setup_env.sh sft
# Reinforcement-learning post-training
bash scripts/setup_env.sh rl
# Data curation
bash scripts/setup_env.sh data-pipeline

The setup script installs the exact upstream versions recorded in uv.lock, validates their versions and source hashes, and then applies the TimePLE integration patches. The repository does not contain complete copies of Transformers, ms-swift, or EasyR1 source files.

The SFT and RL extras are intentionally separate because accelerator stacks often require platform-specific dependency pins. uv.lock records the reference resolution.

Loading the released model

The Hugging Face checkpoint is a weights-and-assets repository. The executable TimePLE implementation is provided by this installable source package rather than duplicated in the model repository. Import timeple once to register the custom configuration, model, and processor with Transformers; Hub-hosted Python code and trust_remote_code=True are not required.

importtorchimporttimeplefromtransformersimportAutoModelForImageTextToText, AutoProcessormodel_id="KlingTeam/TimePLE"processor=AutoProcessor.from_pretrained(model_id)
model=AutoModelForImageTextToText.from_pretrained(
model_id,
dtype=torch.bfloat16,
device_map="auto",
).eval()

Data Preparation

Training and benchmark annotations are released separately as KlingTeam/TimePLE-Dataset. Licensed videos, pretrained weights, and generated checkpoints are not redistributed in this GitHub repository. Place local artifacts under the following repository-relative structure:

TimePLE/
├── checkpoints/
│ ├── base-model/ # Qwen3-VL-8B-Instruct
│ ├── geometry/ # selected geometry artifacts
│ ├── sft-stage1/ # selected stage-1 checkpoint
│ └── TimePLE-8B/ # final release-ready SFT model
└── data/
├── TimePLE-Dataset/ # full local annotation package; ignored by Git
├── sft.jsonl # committed schema examples
└── rl_train.jsonl # committed schema examples

All committed YAML files use paths relative to the TimePLE repository root. The launchers export TIMEPLE_ROOT automatically, so machine-specific absolute paths do not need to be committed.

The committed sft.jsonl and rl_train.jsonl records are 100 text-only schema examples with placeholder video names. They demonstrate the training interface and are not the paper training set. The SFT configs read the full local package from data/TimePLE-Dataset/train/timeple_train.jsonl.

Convert local temporal annotations into the TimePLE SFT and EasyR1 schemas with:

uv run python scripts/data/prepare_sft.py \
--input /path/to/temporal_annotations.jsonl \
--output data/sft.jsonl \
--count 100 \
--seed 2
uv run python scripts/data/prepare_rl.py \
--input data/sft.jsonl \
--output data/rl_train.jsonl

See data/README.md and scripts/data/README.md for the record schemas.

Training TimePLE

TimePLE training consists of three independently launched runs:

  1. interval geometry pretraining;
  2. SFT stage 1 with the interval codec frozen;
  3. SFT stage 2 with the interval codec unfrozen.

The repository does not automatically promote checkpoints between stages. After each run, inspect the validation results and expose the selected artifact at the stable repository-relative path expected by the next config.

Stage 0: Interval Geometry Pretraining

uv run python -m timeple.geometry_pretrain \
--config configs/model/geometry_pretrain_v1.yaml

Each run is saved under a timestamped directory in outputs/geometry_pretrain_v1/. After selecting a run, provide:

checkpoints/geometry/best.pt <- best_timeple_codec_state_dict.pt
checkpoints/geometry/codec_config.json <- codec_config_resolved.json

You may copy or link the selected files, or update the stage-1 config to another repository-relative location.

Stage 1: Frozen-Codec SFT

bash scripts/sft/train_stage1.sh

Stage 1 loads the selected geometry state, freezes the TimePLE encoder and decoder, and trains the language-side temporal interface. Its validation set is created from the full local annotation package through the deterministic split configured in configs/sft/timeple_sft_stage1.yaml.

After training, expose the selected checkpoint as checkpoints/sft-stage1/ or update the stage-2 model field.

Stage 2: Joint SFT

bash scripts/sft/train_stage2.sh

Stage 2 starts from the selected stage-1 model and unfreezes the TimePLE encoder and decoder. It independently creates a deterministic validation split from data/TimePLE-Dataset/train/timeple_train.jsonl.

The final release-ready SFT model is stored locally at checkpoints/TimePLE-8B/.

Optional Post-Training

# GRPO used in the paper's post-SFT study
bash scripts/rl/train_grpo.sh
# Experimental repository extensions
bash scripts/csdo/train_csdo.sh
bash scripts/tr_spd/train_tr_spd.sh

CSDO and TR-SPD are experimental extensions and are not required for the paper's main TimePLE-SFT result.

Data Curation

The training-data pipeline combines heterogeneous teacher VLMs to verify existing temporal annotations and construct additional grounded samples from cross-model event consensus.

The public implementation provides:

  • deterministic preprocessing for Charades-STA and ActivityNet-Captions;
  • Gemini and local-vLLM teacher backends;
  • agreement-based filtering of existing samples;
  • temporal and semantic consensus for newly constructed samples;
  • conversion into TimePLE SFT and RL supervision formats.

Start from data_pipeline/README.md. Teacher checkpoints, API credentials, raw annotations, and licensed videos are supplied locally through copied configuration templates and are never hard-coded in the repository.

Charades-TimePLE

Charades-TimePLE is the human-verified corrected benchmark described in the paper. Its annotations are distributed together with the TimePLE training set in the unified Hugging Face dataset repository:

Important

Dataset:KlingTeam/TimePLE-Dataset

The dataset repository provides the training annotations, corrected benchmark annotations, WebDataset video shards, and integrity metadata.

The human-review interface and annotation-application tools are already available under data_pipeline/bench_cleaning.

Inference and Evaluation

The public evaluation suite supports Charades-STA, ActivityNet-Captions, and QVHighlights with layered dataset/model/prompt profiles, resumable prediction files, distributed sharding, and duration-stratified metrics.

Install the evaluation environment and render a suite without loading the model:

bash scripts/setup_env.sh eval
uv run python evaluation/src/run_eval_suite.py \
--suite evaluation/configs/suites/charades_sta.yaml

Run TimePLE on a benchmark with:

SUITE=charades_sta bash scripts/eval/run_suite.sh --models timeple_8b
SUITE=activitynet_captions bash scripts/eval/run_suite.sh
SUITE=qvhighlights bash scripts/eval/run_suite.sh

See evaluation/README.md for the expected annotation schema, data layout, output files, and distributed evaluation workflow.

Note

The default evaluation profile follows the paper setting of 2 FPS, at most 200 frames, and at most 64 visual tokens per frame. These inference settings are independent of the public training YAML files.

Implementation Notes

Canonical Interval Codec

For a normalized interval [s, e] with duration d = e - s, TimePLE uses:

u = s / (1 - d)
v = d

Every point (u, v) in the canonical square maps back to a valid interval. The output decoder predicts a joint distribution over the square, computes its expected coordinate, and applies a duration-aware bounded residual before recovering continuous boundaries.

Temporal-Token Initialization

When <|TIMESTAMP|> and <|TIMESPAN|> are newly added, their input and output embeddings are initialized using the empirical mean and covariance statistics of the existing vocabulary embeddings. Temporal-token rows already present in a resumed TimePLE checkpoint are preserved.

Repository Layout

PathDescription
src/timeple/modelsCanonical transform, codec, losses, and interface adapters
src/timeple/geometry_pretrainSynthetic geometry training and diagnostics
configsModel, SFT, RL, and DeepSpeed configurations
integrations/transformersVersioned Qwen3-VL integration patch and manifest
integrations/ms_swiftVersioned SFT integration patch and manifest
integrations/easyr1GRPO, CSDO, and TR-SPD integration
data_pipelineTraining-data curation and benchmark correction
rewardsTemporal localization and format rewards

Validation

Run the lightweight repository checks without launching distributed training:

bash scripts/setup_env.sh dev
uv run pytest
uv run python -m compileall -q src integrations rewards scripts tests
bash -n scripts/sft/*.sh scripts/rl/*.sh scripts/csdo/*.sh scripts/tr_spd/*.sh

Citation

If you find TimePLE useful for your research, please consider citing our work:

@article{zeng2026timeple,
title = {TimePLE: Rethinking Temporal Representation for Video Temporal Grounding},
author = {Zeng, Yuhui and Mao, Xinyu and Liu, Xiaokun and Tao, Xin and Huang, Jinfa and Ji, Jiayi and Zheng, Xiawu},
journal = {arXiv preprint},
year = {2026}
}

The citation entry will be updated with the final arXiv identifier.

Acknowledgement

TimePLE is built upon the following open-source projects:

See THIRD_PARTY_NOTICES.md for integration details and upstream licenses.

License

TimePLE is released under the Apache License 2.0. This repository does not redistribute third-party datasets, licensed videos, or pretrained model weights.

About

No description, website, or topics provided.

Resources

Stars

3 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages

, 'i'); if (__m === '*' || __re.test(location.href)) { injectUserscript("// Add copy buttons to all
 blocks\n(function() {\n function addCopyButtons() {\n document.querySelectorAll('pre code').forEach(function(codeBlock) {\n if (codeBlock.parentElement.hasAttribute('data-copy-added')) return;\n codeBlock.parentElement.setAttribute('data-copy-added', 'true');\n \n var btn = document.createElement('button');\n btn.textContent = 'Copy';\n btn.style.cssText = 'position:absolute;top:4px;right:4px;padding:2px 8px;font-size:11px;background:#4ecdc4;border:none;border-radius:4px;color:#1a1a2e;cursor:pointer;opacity:0.7;transition:opacity 0.2s;';\n btn.onmouseover = function() { this.style.opacity = '1'; };\n btn.onmouseout = function() { this.style.opacity = '0.7'; };\n btn.onclick = function() {\n navigator.clipboard.writeText(codeBlock.textContent).then(function() {\n btn.textContent = 'Copied!';\n setTimeout(function() { btn.textContent = 'Copy'; }, 1500);\n });\n };\n codeBlock.parentElement.style.position = 'relative';\n codeBlock.parentElement.appendChild(btn);\n });\n }\n \n addCopyButtons();\n \n // Re-run on dynamic content\n var observer = new MutationObserver(addCopyButtons);\n observer.observe(document.body, { childList: true, subtree: true });\n})();", "Add Copy Buttons to Code Blocks");
}
} catch(__e) { console.warn('[Userscript:Add Copy Buttons to Code Blocks]', __e); }
})();
(function(){
try {
var __m = "github.com";
var __re = new RegExp('^' + "github\\.com" + '
Skip to content

Repository files navigation

TimePLE icon

TimePLE: Rethinking Temporal Representation for Video Temporal Grounding

Yuhui Zeng1,4, Xinyu Mao2,4, Xiaokun Liu4, Xin Tao4, Jinfa Huang3, Jiayi Ji1, Xiawu Zheng1

1Xiamen University 2The Chinese University of Hong Kong 3University of Rochester 4Kling Team, Kuaishou Technology

📄 Paper | 🤗 Model | 🗃️ Data

News

  • 2026-07-20: Released the TimePLE codec, Qwen3-VL integration, SFT, data-curation pipeline, and public training configurations.
  • Available: The TimePLE checkpoint, training annotations, benchmark annotations, and inference/evaluation suite are available now.

Overview

Video temporal grounding (VTG) aims to localize the continuous video interval described by a natural-language query. Existing VLM-based methods commonly represent an interval through two endpoint outputs, either as timestamp tokens or continuous boundary coordinates.

TimePLE reformulates VTG as interval-native prediction. It maps every valid temporal interval to a point in a canonical position-duration square and predicts a single joint distribution over this space. A generated <|TIMESPAN|> token provides the latent output interface, while input-side <|TIMESTAMP|> tokens encode the temporal coverage of sampled visual units using the same interval geometry.

video + query
|
| temporal anchors encoded by <|TIMESTAMP|>
v
VLM hidden states
|
| generated <|TIMESPAN|>
v
joint distribution over the canonical position-duration square
|
| expectation decoding + duration-aware residual refinement
v
continuous temporal interval [start, end]

The released codec uses a 128 x 128 canonical grid, Gaussian bandwidth sigma_u = sigma_v = 0.015, and duration-adaptive residual scale alpha = 0.02.

Release Status

ComponentStatusEntry point
TimePLE interval codecsrc/timeple/models
Geometry pretrainingsrc/timeple/geometry_pretrain
Qwen3-VL / Transformers integrationintegrations/transformers
SFT / ms-swift integrationintegrations/ms_swift
GRPO / EasyR1 integrationintegrations/easyr1
Training-data curationdata_pipeline/train_building
Benchmark human-review toolsdata_pipeline/bench_cleaning
TimePLE-8B checkpointKlingTeam/TimePLE
Training and benchmark annotationsKlingTeam/TimePLE-Dataset
Benchmark inference and evaluationevaluation

Quick Navigation

Installation

Clone the repository and enter the project directory:

git clone https://github.com/KlingAIResearch/TimePLE.git
cd TimePLE

TimePLE uses uv to reproduce exact upstream environments. Build the environment required by the stage you want to run:

# Supervised fine-tuning
bash scripts/setup_env.sh sft
# Reinforcement-learning post-training
bash scripts/setup_env.sh rl
# Data curation
bash scripts/setup_env.sh data-pipeline

The setup script installs the exact upstream versions recorded in uv.lock, validates their versions and source hashes, and then applies the TimePLE integration patches. The repository does not contain complete copies of Transformers, ms-swift, or EasyR1 source files.

The SFT and RL extras are intentionally separate because accelerator stacks often require platform-specific dependency pins. uv.lock records the reference resolution.

Loading the released model

The Hugging Face checkpoint is a weights-and-assets repository. The executable TimePLE implementation is provided by this installable source package rather than duplicated in the model repository. Import timeple once to register the custom configuration, model, and processor with Transformers; Hub-hosted Python code and trust_remote_code=True are not required.

importtorchimporttimeplefromtransformersimportAutoModelForImageTextToText, AutoProcessormodel_id="KlingTeam/TimePLE"processor=AutoProcessor.from_pretrained(model_id)
model=AutoModelForImageTextToText.from_pretrained(
model_id,
dtype=torch.bfloat16,
device_map="auto",
).eval()

Data Preparation

Training and benchmark annotations are released separately as KlingTeam/TimePLE-Dataset. Licensed videos, pretrained weights, and generated checkpoints are not redistributed in this GitHub repository. Place local artifacts under the following repository-relative structure:

TimePLE/
├── checkpoints/
│ ├── base-model/ # Qwen3-VL-8B-Instruct
│ ├── geometry/ # selected geometry artifacts
│ ├── sft-stage1/ # selected stage-1 checkpoint
│ └── TimePLE-8B/ # final release-ready SFT model
└── data/
├── TimePLE-Dataset/ # full local annotation package; ignored by Git
├── sft.jsonl # committed schema examples
└── rl_train.jsonl # committed schema examples

All committed YAML files use paths relative to the TimePLE repository root. The launchers export TIMEPLE_ROOT automatically, so machine-specific absolute paths do not need to be committed.

The committed sft.jsonl and rl_train.jsonl records are 100 text-only schema examples with placeholder video names. They demonstrate the training interface and are not the paper training set. The SFT configs read the full local package from data/TimePLE-Dataset/train/timeple_train.jsonl.

Convert local temporal annotations into the TimePLE SFT and EasyR1 schemas with:

uv run python scripts/data/prepare_sft.py \
--input /path/to/temporal_annotations.jsonl \
--output data/sft.jsonl \
--count 100 \
--seed 2
uv run python scripts/data/prepare_rl.py \
--input data/sft.jsonl \
--output data/rl_train.jsonl

See data/README.md and scripts/data/README.md for the record schemas.

Training TimePLE

TimePLE training consists of three independently launched runs:

  1. interval geometry pretraining;
  2. SFT stage 1 with the interval codec frozen;
  3. SFT stage 2 with the interval codec unfrozen.

The repository does not automatically promote checkpoints between stages. After each run, inspect the validation results and expose the selected artifact at the stable repository-relative path expected by the next config.

Stage 0: Interval Geometry Pretraining

uv run python -m timeple.geometry_pretrain \
--config configs/model/geometry_pretrain_v1.yaml

Each run is saved under a timestamped directory in outputs/geometry_pretrain_v1/. After selecting a run, provide:

checkpoints/geometry/best.pt <- best_timeple_codec_state_dict.pt
checkpoints/geometry/codec_config.json <- codec_config_resolved.json

You may copy or link the selected files, or update the stage-1 config to another repository-relative location.

Stage 1: Frozen-Codec SFT

bash scripts/sft/train_stage1.sh

Stage 1 loads the selected geometry state, freezes the TimePLE encoder and decoder, and trains the language-side temporal interface. Its validation set is created from the full local annotation package through the deterministic split configured in configs/sft/timeple_sft_stage1.yaml.

After training, expose the selected checkpoint as checkpoints/sft-stage1/ or update the stage-2 model field.

Stage 2: Joint SFT

bash scripts/sft/train_stage2.sh

Stage 2 starts from the selected stage-1 model and unfreezes the TimePLE encoder and decoder. It independently creates a deterministic validation split from data/TimePLE-Dataset/train/timeple_train.jsonl.

The final release-ready SFT model is stored locally at checkpoints/TimePLE-8B/.

Optional Post-Training

# GRPO used in the paper's post-SFT study
bash scripts/rl/train_grpo.sh
# Experimental repository extensions
bash scripts/csdo/train_csdo.sh
bash scripts/tr_spd/train_tr_spd.sh

CSDO and TR-SPD are experimental extensions and are not required for the paper's main TimePLE-SFT result.

Data Curation

The training-data pipeline combines heterogeneous teacher VLMs to verify existing temporal annotations and construct additional grounded samples from cross-model event consensus.

The public implementation provides:

  • deterministic preprocessing for Charades-STA and ActivityNet-Captions;
  • Gemini and local-vLLM teacher backends;
  • agreement-based filtering of existing samples;
  • temporal and semantic consensus for newly constructed samples;
  • conversion into TimePLE SFT and RL supervision formats.

Start from data_pipeline/README.md. Teacher checkpoints, API credentials, raw annotations, and licensed videos are supplied locally through copied configuration templates and are never hard-coded in the repository.

Charades-TimePLE

Charades-TimePLE is the human-verified corrected benchmark described in the paper. Its annotations are distributed together with the TimePLE training set in the unified Hugging Face dataset repository:

Important

Dataset:KlingTeam/TimePLE-Dataset

The dataset repository provides the training annotations, corrected benchmark annotations, WebDataset video shards, and integrity metadata.

The human-review interface and annotation-application tools are already available under data_pipeline/bench_cleaning.

Inference and Evaluation

The public evaluation suite supports Charades-STA, ActivityNet-Captions, and QVHighlights with layered dataset/model/prompt profiles, resumable prediction files, distributed sharding, and duration-stratified metrics.

Install the evaluation environment and render a suite without loading the model:

bash scripts/setup_env.sh eval
uv run python evaluation/src/run_eval_suite.py \
--suite evaluation/configs/suites/charades_sta.yaml

Run TimePLE on a benchmark with:

SUITE=charades_sta bash scripts/eval/run_suite.sh --models timeple_8b
SUITE=activitynet_captions bash scripts/eval/run_suite.sh
SUITE=qvhighlights bash scripts/eval/run_suite.sh

See evaluation/README.md for the expected annotation schema, data layout, output files, and distributed evaluation workflow.

Note

The default evaluation profile follows the paper setting of 2 FPS, at most 200 frames, and at most 64 visual tokens per frame. These inference settings are independent of the public training YAML files.

Implementation Notes

Canonical Interval Codec

For a normalized interval [s, e] with duration d = e - s, TimePLE uses:

u = s / (1 - d)
v = d

Every point (u, v) in the canonical square maps back to a valid interval. The output decoder predicts a joint distribution over the square, computes its expected coordinate, and applies a duration-aware bounded residual before recovering continuous boundaries.

Temporal-Token Initialization

When <|TIMESTAMP|> and <|TIMESPAN|> are newly added, their input and output embeddings are initialized using the empirical mean and covariance statistics of the existing vocabulary embeddings. Temporal-token rows already present in a resumed TimePLE checkpoint are preserved.

Repository Layout

PathDescription
src/timeple/modelsCanonical transform, codec, losses, and interface adapters
src/timeple/geometry_pretrainSynthetic geometry training and diagnostics
configsModel, SFT, RL, and DeepSpeed configurations
integrations/transformersVersioned Qwen3-VL integration patch and manifest
integrations/ms_swiftVersioned SFT integration patch and manifest
integrations/easyr1GRPO, CSDO, and TR-SPD integration
data_pipelineTraining-data curation and benchmark correction
rewardsTemporal localization and format rewards

Validation

Run the lightweight repository checks without launching distributed training:

bash scripts/setup_env.sh dev
uv run pytest
uv run python -m compileall -q src integrations rewards scripts tests
bash -n scripts/sft/*.sh scripts/rl/*.sh scripts/csdo/*.sh scripts/tr_spd/*.sh

Citation

If you find TimePLE useful for your research, please consider citing our work:

@article{zeng2026timeple,
title = {TimePLE: Rethinking Temporal Representation for Video Temporal Grounding},
author = {Zeng, Yuhui and Mao, Xinyu and Liu, Xiaokun and Tao, Xin and Huang, Jinfa and Ji, Jiayi and Zheng, Xiawu},
journal = {arXiv preprint},
year = {2026}
}

The citation entry will be updated with the final arXiv identifier.

Acknowledgement

TimePLE is built upon the following open-source projects:

See THIRD_PARTY_NOTICES.md for integration details and upstream licenses.

License

TimePLE is released under the Apache License 2.0. This repository does not redistribute third-party datasets, licensed videos, or pretrained model weights.

About

No description, website, or topics provided.

Resources

Stars

3 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages

, 'i'); if (__m === '*' || __re.test(location.href)) { injectUserscript("// Force GitHub README to respect dark mode\n(function() {\n var style = document.createElement('style');\n style.textContent = '\n .markdown-body {\n color-scheme: dark light;\n }\n .markdown-body pre { background: #161b22 !important; }\n .markdown-body code { background: rgba(110, 118, 129, 0.4) !important; }\n .markdown-body table th, .markdown-body table td { border-color: #30363d !important; }\n .markdown-body img { background: #0d1117; }\n .markdown-body blockquote { border-left-color: #8b949e; }\n .markdown-body hr { border-color: #30363d; }\n ';\n document.head.appendChild(style);\n})();", "GitHub Dark Mode README Fix"); } } catch(__e) { console.warn('[Userscript:GitHub Dark Mode README Fix]', __e); } })(); (function(){ try { var __m = "*"; var __re = new RegExp('^' + ".*" + '
Skip to content

Repository files navigation

TimePLE icon

TimePLE: Rethinking Temporal Representation for Video Temporal Grounding

Yuhui Zeng1,4, Xinyu Mao2,4, Xiaokun Liu4, Xin Tao4, Jinfa Huang3, Jiayi Ji1, Xiawu Zheng1

1Xiamen University 2The Chinese University of Hong Kong 3University of Rochester 4Kling Team, Kuaishou Technology

📄 Paper | 🤗 Model | 🗃️ Data

News

  • 2026-07-20: Released the TimePLE codec, Qwen3-VL integration, SFT, data-curation pipeline, and public training configurations.
  • Available: The TimePLE checkpoint, training annotations, benchmark annotations, and inference/evaluation suite are available now.

Overview

Video temporal grounding (VTG) aims to localize the continuous video interval described by a natural-language query. Existing VLM-based methods commonly represent an interval through two endpoint outputs, either as timestamp tokens or continuous boundary coordinates.

TimePLE reformulates VTG as interval-native prediction. It maps every valid temporal interval to a point in a canonical position-duration square and predicts a single joint distribution over this space. A generated <|TIMESPAN|> token provides the latent output interface, while input-side <|TIMESTAMP|> tokens encode the temporal coverage of sampled visual units using the same interval geometry.

video + query
|
| temporal anchors encoded by <|TIMESTAMP|>
v
VLM hidden states
|
| generated <|TIMESPAN|>
v
joint distribution over the canonical position-duration square
|
| expectation decoding + duration-aware residual refinement
v
continuous temporal interval [start, end]

The released codec uses a 128 x 128 canonical grid, Gaussian bandwidth sigma_u = sigma_v = 0.015, and duration-adaptive residual scale alpha = 0.02.

Release Status

ComponentStatusEntry point
TimePLE interval codecsrc/timeple/models
Geometry pretrainingsrc/timeple/geometry_pretrain
Qwen3-VL / Transformers integrationintegrations/transformers
SFT / ms-swift integrationintegrations/ms_swift
GRPO / EasyR1 integrationintegrations/easyr1
Training-data curationdata_pipeline/train_building
Benchmark human-review toolsdata_pipeline/bench_cleaning
TimePLE-8B checkpointKlingTeam/TimePLE
Training and benchmark annotationsKlingTeam/TimePLE-Dataset
Benchmark inference and evaluationevaluation

Quick Navigation

Installation

Clone the repository and enter the project directory:

git clone https://github.com/KlingAIResearch/TimePLE.git
cd TimePLE

TimePLE uses uv to reproduce exact upstream environments. Build the environment required by the stage you want to run:

# Supervised fine-tuning
bash scripts/setup_env.sh sft
# Reinforcement-learning post-training
bash scripts/setup_env.sh rl
# Data curation
bash scripts/setup_env.sh data-pipeline

The setup script installs the exact upstream versions recorded in uv.lock, validates their versions and source hashes, and then applies the TimePLE integration patches. The repository does not contain complete copies of Transformers, ms-swift, or EasyR1 source files.

The SFT and RL extras are intentionally separate because accelerator stacks often require platform-specific dependency pins. uv.lock records the reference resolution.

Loading the released model

The Hugging Face checkpoint is a weights-and-assets repository. The executable TimePLE implementation is provided by this installable source package rather than duplicated in the model repository. Import timeple once to register the custom configuration, model, and processor with Transformers; Hub-hosted Python code and trust_remote_code=True are not required.

importtorchimporttimeplefromtransformersimportAutoModelForImageTextToText, AutoProcessormodel_id="KlingTeam/TimePLE"processor=AutoProcessor.from_pretrained(model_id)
model=AutoModelForImageTextToText.from_pretrained(
model_id,
dtype=torch.bfloat16,
device_map="auto",
).eval()

Data Preparation

Training and benchmark annotations are released separately as KlingTeam/TimePLE-Dataset. Licensed videos, pretrained weights, and generated checkpoints are not redistributed in this GitHub repository. Place local artifacts under the following repository-relative structure:

TimePLE/
├── checkpoints/
│ ├── base-model/ # Qwen3-VL-8B-Instruct
│ ├── geometry/ # selected geometry artifacts
│ ├── sft-stage1/ # selected stage-1 checkpoint
│ └── TimePLE-8B/ # final release-ready SFT model
└── data/
├── TimePLE-Dataset/ # full local annotation package; ignored by Git
├── sft.jsonl # committed schema examples
└── rl_train.jsonl # committed schema examples

All committed YAML files use paths relative to the TimePLE repository root. The launchers export TIMEPLE_ROOT automatically, so machine-specific absolute paths do not need to be committed.

The committed sft.jsonl and rl_train.jsonl records are 100 text-only schema examples with placeholder video names. They demonstrate the training interface and are not the paper training set. The SFT configs read the full local package from data/TimePLE-Dataset/train/timeple_train.jsonl.

Convert local temporal annotations into the TimePLE SFT and EasyR1 schemas with:

uv run python scripts/data/prepare_sft.py \
--input /path/to/temporal_annotations.jsonl \
--output data/sft.jsonl \
--count 100 \
--seed 2
uv run python scripts/data/prepare_rl.py \
--input data/sft.jsonl \
--output data/rl_train.jsonl

See data/README.md and scripts/data/README.md for the record schemas.

Training TimePLE

TimePLE training consists of three independently launched runs:

  1. interval geometry pretraining;
  2. SFT stage 1 with the interval codec frozen;
  3. SFT stage 2 with the interval codec unfrozen.

The repository does not automatically promote checkpoints between stages. After each run, inspect the validation results and expose the selected artifact at the stable repository-relative path expected by the next config.

Stage 0: Interval Geometry Pretraining

uv run python -m timeple.geometry_pretrain \
--config configs/model/geometry_pretrain_v1.yaml

Each run is saved under a timestamped directory in outputs/geometry_pretrain_v1/. After selecting a run, provide:

checkpoints/geometry/best.pt <- best_timeple_codec_state_dict.pt
checkpoints/geometry/codec_config.json <- codec_config_resolved.json

You may copy or link the selected files, or update the stage-1 config to another repository-relative location.

Stage 1: Frozen-Codec SFT

bash scripts/sft/train_stage1.sh

Stage 1 loads the selected geometry state, freezes the TimePLE encoder and decoder, and trains the language-side temporal interface. Its validation set is created from the full local annotation package through the deterministic split configured in configs/sft/timeple_sft_stage1.yaml.

After training, expose the selected checkpoint as checkpoints/sft-stage1/ or update the stage-2 model field.

Stage 2: Joint SFT

bash scripts/sft/train_stage2.sh

Stage 2 starts from the selected stage-1 model and unfreezes the TimePLE encoder and decoder. It independently creates a deterministic validation split from data/TimePLE-Dataset/train/timeple_train.jsonl.

The final release-ready SFT model is stored locally at checkpoints/TimePLE-8B/.

Optional Post-Training

# GRPO used in the paper's post-SFT study
bash scripts/rl/train_grpo.sh
# Experimental repository extensions
bash scripts/csdo/train_csdo.sh
bash scripts/tr_spd/train_tr_spd.sh

CSDO and TR-SPD are experimental extensions and are not required for the paper's main TimePLE-SFT result.

Data Curation

The training-data pipeline combines heterogeneous teacher VLMs to verify existing temporal annotations and construct additional grounded samples from cross-model event consensus.

The public implementation provides:

  • deterministic preprocessing for Charades-STA and ActivityNet-Captions;
  • Gemini and local-vLLM teacher backends;
  • agreement-based filtering of existing samples;
  • temporal and semantic consensus for newly constructed samples;
  • conversion into TimePLE SFT and RL supervision formats.

Start from data_pipeline/README.md. Teacher checkpoints, API credentials, raw annotations, and licensed videos are supplied locally through copied configuration templates and are never hard-coded in the repository.

Charades-TimePLE

Charades-TimePLE is the human-verified corrected benchmark described in the paper. Its annotations are distributed together with the TimePLE training set in the unified Hugging Face dataset repository:

Important

Dataset:KlingTeam/TimePLE-Dataset

The dataset repository provides the training annotations, corrected benchmark annotations, WebDataset video shards, and integrity metadata.

The human-review interface and annotation-application tools are already available under data_pipeline/bench_cleaning.

Inference and Evaluation

The public evaluation suite supports Charades-STA, ActivityNet-Captions, and QVHighlights with layered dataset/model/prompt profiles, resumable prediction files, distributed sharding, and duration-stratified metrics.

Install the evaluation environment and render a suite without loading the model:

bash scripts/setup_env.sh eval
uv run python evaluation/src/run_eval_suite.py \
--suite evaluation/configs/suites/charades_sta.yaml

Run TimePLE on a benchmark with:

SUITE=charades_sta bash scripts/eval/run_suite.sh --models timeple_8b
SUITE=activitynet_captions bash scripts/eval/run_suite.sh
SUITE=qvhighlights bash scripts/eval/run_suite.sh

See evaluation/README.md for the expected annotation schema, data layout, output files, and distributed evaluation workflow.

Note

The default evaluation profile follows the paper setting of 2 FPS, at most 200 frames, and at most 64 visual tokens per frame. These inference settings are independent of the public training YAML files.

Implementation Notes

Canonical Interval Codec

For a normalized interval [s, e] with duration d = e - s, TimePLE uses:

u = s / (1 - d)
v = d

Every point (u, v) in the canonical square maps back to a valid interval. The output decoder predicts a joint distribution over the square, computes its expected coordinate, and applies a duration-aware bounded residual before recovering continuous boundaries.

Temporal-Token Initialization

When <|TIMESTAMP|> and <|TIMESPAN|> are newly added, their input and output embeddings are initialized using the empirical mean and covariance statistics of the existing vocabulary embeddings. Temporal-token rows already present in a resumed TimePLE checkpoint are preserved.

Repository Layout

PathDescription
src/timeple/modelsCanonical transform, codec, losses, and interface adapters
src/timeple/geometry_pretrainSynthetic geometry training and diagnostics
configsModel, SFT, RL, and DeepSpeed configurations
integrations/transformersVersioned Qwen3-VL integration patch and manifest
integrations/ms_swiftVersioned SFT integration patch and manifest
integrations/easyr1GRPO, CSDO, and TR-SPD integration
data_pipelineTraining-data curation and benchmark correction
rewardsTemporal localization and format rewards

Validation

Run the lightweight repository checks without launching distributed training:

bash scripts/setup_env.sh dev
uv run pytest
uv run python -m compileall -q src integrations rewards scripts tests
bash -n scripts/sft/*.sh scripts/rl/*.sh scripts/csdo/*.sh scripts/tr_spd/*.sh

Citation

If you find TimePLE useful for your research, please consider citing our work:

@article{zeng2026timeple,
title = {TimePLE: Rethinking Temporal Representation for Video Temporal Grounding},
author = {Zeng, Yuhui and Mao, Xinyu and Liu, Xiaokun and Tao, Xin and Huang, Jinfa and Ji, Jiayi and Zheng, Xiawu},
journal = {arXiv preprint},
year = {2026}
}

The citation entry will be updated with the final arXiv identifier.

Acknowledgement

TimePLE is built upon the following open-source projects:

See THIRD_PARTY_NOTICES.md for integration details and upstream licenses.

License

TimePLE is released under the Apache License 2.0. This repository does not redistribute third-party datasets, licensed videos, or pretrained model weights.

About

No description, website, or topics provided.

Resources

Stars

3 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages

, 'i'); if (__m === '*' || __re.test(location.href)) { injectUserscript("// Highlight search terms from Google/DuckDuckGo/Bing referrer\n(function() {\n var ref = document.referrer;\n var terms = [];\n \n if (ref.includes('google.com') || ref.includes('duckduckgo.com') || ref.includes('bing.com')) {\n var url = new URL(ref);\n var q = url.searchParams.get('q') || url.searchParams.get('p');\n if (q) {\n terms = q.split(/\\s+/).filter(function(t) { return t.length > 2; });\n }\n }\n \n if (terms.length === 0) return;\n \n var style = document.createElement('style');\n style.textContent = '.userscript-highlight { background: #fbbf24; color: #1a1a2e; padding: 1px 3px; border-radius: 2px; }';\n document.head.appendChild(style);\n \n function highlight(node) {\n if (node.nodeType === 3) { // text node\n var text = node.textContent;\n var found = false;\n terms.forEach(function(term) {\n var regex = new RegExp('(' + term.replace(/[.*+?^${}()|[\\]\\\\]/g, '\\\\') + ')', 'gi');\n if (regex.test(text)) {\n found = true;\n var frag = document.createDocumentFragment();\n var parts = text.split(regex);\n parts.forEach(function(part, i) {\n if (i % 2 === 0) {\n frag.appendChild(document.createTextNode(part));\n } else {\n var span = document.createElement('span');\n span.className = 'userscript-highlight';\n span.textContent = part;\n frag.appendChild(span);\n }\n });\n node.parentNode.replaceChild(frag, node);\n }\n });\n } else if (node.nodeType === 1 && node.childNodes) { // element\n var skipTags = ['SCRIPT', 'STYLE', 'NOSCRIPT', 'TEXTAREA', 'INPUT', 'SELECT'];\n if (!skipTags.includes(node.tagName)) {\n Array.from(node.childNodes).forEach(highlight);\n }\n }\n }\n \n highlight(document.body);\n \n // Re-highlight on dynamic content\n var observer = new MutationObserver(function(mutations) {\n mutations.forEach(function(m) {\n m.addedNodes.forEach(function(node) {\n if (node.nodeType === 1 || node.nodeType === 3) highlight(node);\n });\n });\n });\n observer.observe(document.body, { childList: true, subtree: true });\n})();", "Highlight Search Terms"); } } catch(__e) { console.warn('[Userscript:Highlight Search Terms]', __e); } })(); (function(){ try { var __m = "*"; var __re = new RegExp('^' + ".*" + '
Skip to content

Repository files navigation

TimePLE icon

TimePLE: Rethinking Temporal Representation for Video Temporal Grounding

Yuhui Zeng1,4, Xinyu Mao2,4, Xiaokun Liu4, Xin Tao4, Jinfa Huang3, Jiayi Ji1, Xiawu Zheng1

1Xiamen University 2The Chinese University of Hong Kong 3University of Rochester 4Kling Team, Kuaishou Technology

📄 Paper | 🤗 Model | 🗃️ Data

News

  • 2026-07-20: Released the TimePLE codec, Qwen3-VL integration, SFT, data-curation pipeline, and public training configurations.
  • Available: The TimePLE checkpoint, training annotations, benchmark annotations, and inference/evaluation suite are available now.

Overview

Video temporal grounding (VTG) aims to localize the continuous video interval described by a natural-language query. Existing VLM-based methods commonly represent an interval through two endpoint outputs, either as timestamp tokens or continuous boundary coordinates.

TimePLE reformulates VTG as interval-native prediction. It maps every valid temporal interval to a point in a canonical position-duration square and predicts a single joint distribution over this space. A generated <|TIMESPAN|> token provides the latent output interface, while input-side <|TIMESTAMP|> tokens encode the temporal coverage of sampled visual units using the same interval geometry.

video + query
|
| temporal anchors encoded by <|TIMESTAMP|>
v
VLM hidden states
|
| generated <|TIMESPAN|>
v
joint distribution over the canonical position-duration square
|
| expectation decoding + duration-aware residual refinement
v
continuous temporal interval [start, end]

The released codec uses a 128 x 128 canonical grid, Gaussian bandwidth sigma_u = sigma_v = 0.015, and duration-adaptive residual scale alpha = 0.02.

Release Status

ComponentStatusEntry point
TimePLE interval codecsrc/timeple/models
Geometry pretrainingsrc/timeple/geometry_pretrain
Qwen3-VL / Transformers integrationintegrations/transformers
SFT / ms-swift integrationintegrations/ms_swift
GRPO / EasyR1 integrationintegrations/easyr1
Training-data curationdata_pipeline/train_building
Benchmark human-review toolsdata_pipeline/bench_cleaning
TimePLE-8B checkpointKlingTeam/TimePLE
Training and benchmark annotationsKlingTeam/TimePLE-Dataset
Benchmark inference and evaluationevaluation

Quick Navigation

Installation

Clone the repository and enter the project directory:

git clone https://github.com/KlingAIResearch/TimePLE.git
cd TimePLE

TimePLE uses uv to reproduce exact upstream environments. Build the environment required by the stage you want to run:

# Supervised fine-tuning
bash scripts/setup_env.sh sft
# Reinforcement-learning post-training
bash scripts/setup_env.sh rl
# Data curation
bash scripts/setup_env.sh data-pipeline

The setup script installs the exact upstream versions recorded in uv.lock, validates their versions and source hashes, and then applies the TimePLE integration patches. The repository does not contain complete copies of Transformers, ms-swift, or EasyR1 source files.

The SFT and RL extras are intentionally separate because accelerator stacks often require platform-specific dependency pins. uv.lock records the reference resolution.

Loading the released model

The Hugging Face checkpoint is a weights-and-assets repository. The executable TimePLE implementation is provided by this installable source package rather than duplicated in the model repository. Import timeple once to register the custom configuration, model, and processor with Transformers; Hub-hosted Python code and trust_remote_code=True are not required.

importtorchimporttimeplefromtransformersimportAutoModelForImageTextToText, AutoProcessormodel_id="KlingTeam/TimePLE"processor=AutoProcessor.from_pretrained(model_id)
model=AutoModelForImageTextToText.from_pretrained(
model_id,
dtype=torch.bfloat16,
device_map="auto",
).eval()

Data Preparation

Training and benchmark annotations are released separately as KlingTeam/TimePLE-Dataset. Licensed videos, pretrained weights, and generated checkpoints are not redistributed in this GitHub repository. Place local artifacts under the following repository-relative structure:

TimePLE/
├── checkpoints/
│ ├── base-model/ # Qwen3-VL-8B-Instruct
│ ├── geometry/ # selected geometry artifacts
│ ├── sft-stage1/ # selected stage-1 checkpoint
│ └── TimePLE-8B/ # final release-ready SFT model
└── data/
├── TimePLE-Dataset/ # full local annotation package; ignored by Git
├── sft.jsonl # committed schema examples
└── rl_train.jsonl # committed schema examples

All committed YAML files use paths relative to the TimePLE repository root. The launchers export TIMEPLE_ROOT automatically, so machine-specific absolute paths do not need to be committed.

The committed sft.jsonl and rl_train.jsonl records are 100 text-only schema examples with placeholder video names. They demonstrate the training interface and are not the paper training set. The SFT configs read the full local package from data/TimePLE-Dataset/train/timeple_train.jsonl.

Convert local temporal annotations into the TimePLE SFT and EasyR1 schemas with:

uv run python scripts/data/prepare_sft.py \
--input /path/to/temporal_annotations.jsonl \
--output data/sft.jsonl \
--count 100 \
--seed 2
uv run python scripts/data/prepare_rl.py \
--input data/sft.jsonl \
--output data/rl_train.jsonl

See data/README.md and scripts/data/README.md for the record schemas.

Training TimePLE

TimePLE training consists of three independently launched runs:

  1. interval geometry pretraining;
  2. SFT stage 1 with the interval codec frozen;
  3. SFT stage 2 with the interval codec unfrozen.

The repository does not automatically promote checkpoints between stages. After each run, inspect the validation results and expose the selected artifact at the stable repository-relative path expected by the next config.

Stage 0: Interval Geometry Pretraining

uv run python -m timeple.geometry_pretrain \
--config configs/model/geometry_pretrain_v1.yaml

Each run is saved under a timestamped directory in outputs/geometry_pretrain_v1/. After selecting a run, provide:

checkpoints/geometry/best.pt <- best_timeple_codec_state_dict.pt
checkpoints/geometry/codec_config.json <- codec_config_resolved.json

You may copy or link the selected files, or update the stage-1 config to another repository-relative location.

Stage 1: Frozen-Codec SFT

bash scripts/sft/train_stage1.sh

Stage 1 loads the selected geometry state, freezes the TimePLE encoder and decoder, and trains the language-side temporal interface. Its validation set is created from the full local annotation package through the deterministic split configured in configs/sft/timeple_sft_stage1.yaml.

After training, expose the selected checkpoint as checkpoints/sft-stage1/ or update the stage-2 model field.

Stage 2: Joint SFT

bash scripts/sft/train_stage2.sh

Stage 2 starts from the selected stage-1 model and unfreezes the TimePLE encoder and decoder. It independently creates a deterministic validation split from data/TimePLE-Dataset/train/timeple_train.jsonl.

The final release-ready SFT model is stored locally at checkpoints/TimePLE-8B/.

Optional Post-Training

# GRPO used in the paper's post-SFT study
bash scripts/rl/train_grpo.sh
# Experimental repository extensions
bash scripts/csdo/train_csdo.sh
bash scripts/tr_spd/train_tr_spd.sh

CSDO and TR-SPD are experimental extensions and are not required for the paper's main TimePLE-SFT result.

Data Curation

The training-data pipeline combines heterogeneous teacher VLMs to verify existing temporal annotations and construct additional grounded samples from cross-model event consensus.

The public implementation provides:

  • deterministic preprocessing for Charades-STA and ActivityNet-Captions;
  • Gemini and local-vLLM teacher backends;
  • agreement-based filtering of existing samples;
  • temporal and semantic consensus for newly constructed samples;
  • conversion into TimePLE SFT and RL supervision formats.

Start from data_pipeline/README.md. Teacher checkpoints, API credentials, raw annotations, and licensed videos are supplied locally through copied configuration templates and are never hard-coded in the repository.

Charades-TimePLE

Charades-TimePLE is the human-verified corrected benchmark described in the paper. Its annotations are distributed together with the TimePLE training set in the unified Hugging Face dataset repository:

Important

Dataset:KlingTeam/TimePLE-Dataset

The dataset repository provides the training annotations, corrected benchmark annotations, WebDataset video shards, and integrity metadata.

The human-review interface and annotation-application tools are already available under data_pipeline/bench_cleaning.

Inference and Evaluation

The public evaluation suite supports Charades-STA, ActivityNet-Captions, and QVHighlights with layered dataset/model/prompt profiles, resumable prediction files, distributed sharding, and duration-stratified metrics.

Install the evaluation environment and render a suite without loading the model:

bash scripts/setup_env.sh eval
uv run python evaluation/src/run_eval_suite.py \
--suite evaluation/configs/suites/charades_sta.yaml

Run TimePLE on a benchmark with:

SUITE=charades_sta bash scripts/eval/run_suite.sh --models timeple_8b
SUITE=activitynet_captions bash scripts/eval/run_suite.sh
SUITE=qvhighlights bash scripts/eval/run_suite.sh

See evaluation/README.md for the expected annotation schema, data layout, output files, and distributed evaluation workflow.

Note

The default evaluation profile follows the paper setting of 2 FPS, at most 200 frames, and at most 64 visual tokens per frame. These inference settings are independent of the public training YAML files.

Implementation Notes

Canonical Interval Codec

For a normalized interval [s, e] with duration d = e - s, TimePLE uses:

u = s / (1 - d)
v = d

Every point (u, v) in the canonical square maps back to a valid interval. The output decoder predicts a joint distribution over the square, computes its expected coordinate, and applies a duration-aware bounded residual before recovering continuous boundaries.

Temporal-Token Initialization

When <|TIMESTAMP|> and <|TIMESPAN|> are newly added, their input and output embeddings are initialized using the empirical mean and covariance statistics of the existing vocabulary embeddings. Temporal-token rows already present in a resumed TimePLE checkpoint are preserved.

Repository Layout

PathDescription
src/timeple/modelsCanonical transform, codec, losses, and interface adapters
src/timeple/geometry_pretrainSynthetic geometry training and diagnostics
configsModel, SFT, RL, and DeepSpeed configurations
integrations/transformersVersioned Qwen3-VL integration patch and manifest
integrations/ms_swiftVersioned SFT integration patch and manifest
integrations/easyr1GRPO, CSDO, and TR-SPD integration
data_pipelineTraining-data curation and benchmark correction
rewardsTemporal localization and format rewards

Validation

Run the lightweight repository checks without launching distributed training:

bash scripts/setup_env.sh dev
uv run pytest
uv run python -m compileall -q src integrations rewards scripts tests
bash -n scripts/sft/*.sh scripts/rl/*.sh scripts/csdo/*.sh scripts/tr_spd/*.sh

Citation

If you find TimePLE useful for your research, please consider citing our work:

@article{zeng2026timeple,
title = {TimePLE: Rethinking Temporal Representation for Video Temporal Grounding},
author = {Zeng, Yuhui and Mao, Xinyu and Liu, Xiaokun and Tao, Xin and Huang, Jinfa and Ji, Jiayi and Zheng, Xiawu},
journal = {arXiv preprint},
year = {2026}
}

The citation entry will be updated with the final arXiv identifier.

Acknowledgement

TimePLE is built upon the following open-source projects:

See THIRD_PARTY_NOTICES.md for integration details and upstream licenses.

License

TimePLE is released under the Apache License 2.0. This repository does not redistribute third-party datasets, licensed videos, or pretrained model weights.

About

No description, website, or topics provided.

Resources

Stars

3 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages

, 'i'); if (__m === '*' || __re.test(location.href)) { injectUserscript("// Strip utm_, fbclid, gclid, etc. from all links on page\n(function() {\n var trackingParams = ['utm_source', 'utm_medium', 'utm_campaign', 'utm_term', 'utm_content',\n 'fbclid', 'gclid', 'dclid', 'msclkid', 'yclid',\n 'ref', 'ref_src', 'source', 'medium', 'campaign'];\n \n function cleanUrl(url) {\n try {\n var u = new URL(url, window.location.origin);\n var changed = false;\n trackingParams.forEach(function(p) {\n if (u.searchParams.has(p)) {\n u.searchParams.delete(p);\n changed = true;\n }\n });\n return changed ? u.toString() : url;\n } catch (e) {\n return url;\n }\n }\n \n function cleanLinks() {\n document.querySelectorAll('a[href]').forEach(function(a) {\n var clean = cleanUrl(a.href);\n if (clean !== a.href) a.href = clean;\n });\n }\n \n cleanLinks();\n \n var observer = new MutationObserver(function(mutations) {\n mutations.forEach(function(m) {\n m.addedNodes.forEach(function(node) {\n if (node.nodeType === 1) {\n if (node.tagName === 'A') cleanLinks();\n node.querySelectorAll('a[href]').forEach(function(a) {\n var clean = cleanUrl(a.href);\n if (clean !== a.href) a.href = clean;\n });\n }\n });\n });\n });\n observer.observe(document.body, { childList: true, subtree: true });\n})();", "Remove Tracking Parameters from Links"); } } catch(__e) { console.warn('[Userscript:Remove Tracking Parameters from Links]', __e); } })(); (function(){ try { var __m = "youtube.com"; var __re = new RegExp('^' + "youtube\\.com" + '
Skip to content

Repository files navigation

TimePLE icon

TimePLE: Rethinking Temporal Representation for Video Temporal Grounding

Yuhui Zeng1,4, Xinyu Mao2,4, Xiaokun Liu4, Xin Tao4, Jinfa Huang3, Jiayi Ji1, Xiawu Zheng1

1Xiamen University 2The Chinese University of Hong Kong 3University of Rochester 4Kling Team, Kuaishou Technology

📄 Paper | 🤗 Model | 🗃️ Data

News

  • 2026-07-20: Released the TimePLE codec, Qwen3-VL integration, SFT, data-curation pipeline, and public training configurations.
  • Available: The TimePLE checkpoint, training annotations, benchmark annotations, and inference/evaluation suite are available now.

Overview

Video temporal grounding (VTG) aims to localize the continuous video interval described by a natural-language query. Existing VLM-based methods commonly represent an interval through two endpoint outputs, either as timestamp tokens or continuous boundary coordinates.

TimePLE reformulates VTG as interval-native prediction. It maps every valid temporal interval to a point in a canonical position-duration square and predicts a single joint distribution over this space. A generated <|TIMESPAN|> token provides the latent output interface, while input-side <|TIMESTAMP|> tokens encode the temporal coverage of sampled visual units using the same interval geometry.

video + query
|
| temporal anchors encoded by <|TIMESTAMP|>
v
VLM hidden states
|
| generated <|TIMESPAN|>
v
joint distribution over the canonical position-duration square
|
| expectation decoding + duration-aware residual refinement
v
continuous temporal interval [start, end]

The released codec uses a 128 x 128 canonical grid, Gaussian bandwidth sigma_u = sigma_v = 0.015, and duration-adaptive residual scale alpha = 0.02.

Release Status

ComponentStatusEntry point
TimePLE interval codecsrc/timeple/models
Geometry pretrainingsrc/timeple/geometry_pretrain
Qwen3-VL / Transformers integrationintegrations/transformers
SFT / ms-swift integrationintegrations/ms_swift
GRPO / EasyR1 integrationintegrations/easyr1
Training-data curationdata_pipeline/train_building
Benchmark human-review toolsdata_pipeline/bench_cleaning
TimePLE-8B checkpointKlingTeam/TimePLE
Training and benchmark annotationsKlingTeam/TimePLE-Dataset
Benchmark inference and evaluationevaluation

Quick Navigation

Installation

Clone the repository and enter the project directory:

git clone https://github.com/KlingAIResearch/TimePLE.git
cd TimePLE

TimePLE uses uv to reproduce exact upstream environments. Build the environment required by the stage you want to run:

# Supervised fine-tuning
bash scripts/setup_env.sh sft
# Reinforcement-learning post-training
bash scripts/setup_env.sh rl
# Data curation
bash scripts/setup_env.sh data-pipeline

The setup script installs the exact upstream versions recorded in uv.lock, validates their versions and source hashes, and then applies the TimePLE integration patches. The repository does not contain complete copies of Transformers, ms-swift, or EasyR1 source files.

The SFT and RL extras are intentionally separate because accelerator stacks often require platform-specific dependency pins. uv.lock records the reference resolution.

Loading the released model

The Hugging Face checkpoint is a weights-and-assets repository. The executable TimePLE implementation is provided by this installable source package rather than duplicated in the model repository. Import timeple once to register the custom configuration, model, and processor with Transformers; Hub-hosted Python code and trust_remote_code=True are not required.

importtorchimporttimeplefromtransformersimportAutoModelForImageTextToText, AutoProcessormodel_id="KlingTeam/TimePLE"processor=AutoProcessor.from_pretrained(model_id)
model=AutoModelForImageTextToText.from_pretrained(
model_id,
dtype=torch.bfloat16,
device_map="auto",
).eval()

Data Preparation

Training and benchmark annotations are released separately as KlingTeam/TimePLE-Dataset. Licensed videos, pretrained weights, and generated checkpoints are not redistributed in this GitHub repository. Place local artifacts under the following repository-relative structure:

TimePLE/
├── checkpoints/
│ ├── base-model/ # Qwen3-VL-8B-Instruct
│ ├── geometry/ # selected geometry artifacts
│ ├── sft-stage1/ # selected stage-1 checkpoint
│ └── TimePLE-8B/ # final release-ready SFT model
└── data/
├── TimePLE-Dataset/ # full local annotation package; ignored by Git
├── sft.jsonl # committed schema examples
└── rl_train.jsonl # committed schema examples

All committed YAML files use paths relative to the TimePLE repository root. The launchers export TIMEPLE_ROOT automatically, so machine-specific absolute paths do not need to be committed.

The committed sft.jsonl and rl_train.jsonl records are 100 text-only schema examples with placeholder video names. They demonstrate the training interface and are not the paper training set. The SFT configs read the full local package from data/TimePLE-Dataset/train/timeple_train.jsonl.

Convert local temporal annotations into the TimePLE SFT and EasyR1 schemas with:

uv run python scripts/data/prepare_sft.py \
--input /path/to/temporal_annotations.jsonl \
--output data/sft.jsonl \
--count 100 \
--seed 2
uv run python scripts/data/prepare_rl.py \
--input data/sft.jsonl \
--output data/rl_train.jsonl

See data/README.md and scripts/data/README.md for the record schemas.

Training TimePLE

TimePLE training consists of three independently launched runs:

  1. interval geometry pretraining;
  2. SFT stage 1 with the interval codec frozen;
  3. SFT stage 2 with the interval codec unfrozen.

The repository does not automatically promote checkpoints between stages. After each run, inspect the validation results and expose the selected artifact at the stable repository-relative path expected by the next config.

Stage 0: Interval Geometry Pretraining

uv run python -m timeple.geometry_pretrain \
--config configs/model/geometry_pretrain_v1.yaml

Each run is saved under a timestamped directory in outputs/geometry_pretrain_v1/. After selecting a run, provide:

checkpoints/geometry/best.pt <- best_timeple_codec_state_dict.pt
checkpoints/geometry/codec_config.json <- codec_config_resolved.json

You may copy or link the selected files, or update the stage-1 config to another repository-relative location.

Stage 1: Frozen-Codec SFT

bash scripts/sft/train_stage1.sh

Stage 1 loads the selected geometry state, freezes the TimePLE encoder and decoder, and trains the language-side temporal interface. Its validation set is created from the full local annotation package through the deterministic split configured in configs/sft/timeple_sft_stage1.yaml.

After training, expose the selected checkpoint as checkpoints/sft-stage1/ or update the stage-2 model field.

Stage 2: Joint SFT

bash scripts/sft/train_stage2.sh

Stage 2 starts from the selected stage-1 model and unfreezes the TimePLE encoder and decoder. It independently creates a deterministic validation split from data/TimePLE-Dataset/train/timeple_train.jsonl.

The final release-ready SFT model is stored locally at checkpoints/TimePLE-8B/.

Optional Post-Training

# GRPO used in the paper's post-SFT study
bash scripts/rl/train_grpo.sh
# Experimental repository extensions
bash scripts/csdo/train_csdo.sh
bash scripts/tr_spd/train_tr_spd.sh

CSDO and TR-SPD are experimental extensions and are not required for the paper's main TimePLE-SFT result.

Data Curation

The training-data pipeline combines heterogeneous teacher VLMs to verify existing temporal annotations and construct additional grounded samples from cross-model event consensus.

The public implementation provides:

  • deterministic preprocessing for Charades-STA and ActivityNet-Captions;
  • Gemini and local-vLLM teacher backends;
  • agreement-based filtering of existing samples;
  • temporal and semantic consensus for newly constructed samples;
  • conversion into TimePLE SFT and RL supervision formats.

Start from data_pipeline/README.md. Teacher checkpoints, API credentials, raw annotations, and licensed videos are supplied locally through copied configuration templates and are never hard-coded in the repository.

Charades-TimePLE

Charades-TimePLE is the human-verified corrected benchmark described in the paper. Its annotations are distributed together with the TimePLE training set in the unified Hugging Face dataset repository:

Important

Dataset:KlingTeam/TimePLE-Dataset

The dataset repository provides the training annotations, corrected benchmark annotations, WebDataset video shards, and integrity metadata.

The human-review interface and annotation-application tools are already available under data_pipeline/bench_cleaning.

Inference and Evaluation

The public evaluation suite supports Charades-STA, ActivityNet-Captions, and QVHighlights with layered dataset/model/prompt profiles, resumable prediction files, distributed sharding, and duration-stratified metrics.

Install the evaluation environment and render a suite without loading the model:

bash scripts/setup_env.sh eval
uv run python evaluation/src/run_eval_suite.py \
--suite evaluation/configs/suites/charades_sta.yaml

Run TimePLE on a benchmark with:

SUITE=charades_sta bash scripts/eval/run_suite.sh --models timeple_8b
SUITE=activitynet_captions bash scripts/eval/run_suite.sh
SUITE=qvhighlights bash scripts/eval/run_suite.sh

See evaluation/README.md for the expected annotation schema, data layout, output files, and distributed evaluation workflow.

Note

The default evaluation profile follows the paper setting of 2 FPS, at most 200 frames, and at most 64 visual tokens per frame. These inference settings are independent of the public training YAML files.

Implementation Notes

Canonical Interval Codec

For a normalized interval [s, e] with duration d = e - s, TimePLE uses:

u = s / (1 - d)
v = d

Every point (u, v) in the canonical square maps back to a valid interval. The output decoder predicts a joint distribution over the square, computes its expected coordinate, and applies a duration-aware bounded residual before recovering continuous boundaries.

Temporal-Token Initialization

When <|TIMESTAMP|> and <|TIMESPAN|> are newly added, their input and output embeddings are initialized using the empirical mean and covariance statistics of the existing vocabulary embeddings. Temporal-token rows already present in a resumed TimePLE checkpoint are preserved.

Repository Layout

PathDescription
src/timeple/modelsCanonical transform, codec, losses, and interface adapters
src/timeple/geometry_pretrainSynthetic geometry training and diagnostics
configsModel, SFT, RL, and DeepSpeed configurations
integrations/transformersVersioned Qwen3-VL integration patch and manifest
integrations/ms_swiftVersioned SFT integration patch and manifest
integrations/easyr1GRPO, CSDO, and TR-SPD integration
data_pipelineTraining-data curation and benchmark correction
rewardsTemporal localization and format rewards

Validation

Run the lightweight repository checks without launching distributed training:

bash scripts/setup_env.sh dev
uv run pytest
uv run python -m compileall -q src integrations rewards scripts tests
bash -n scripts/sft/*.sh scripts/rl/*.sh scripts/csdo/*.sh scripts/tr_spd/*.sh

Citation

If you find TimePLE useful for your research, please consider citing our work:

@article{zeng2026timeple,
title = {TimePLE: Rethinking Temporal Representation for Video Temporal Grounding},
author = {Zeng, Yuhui and Mao, Xinyu and Liu, Xiaokun and Tao, Xin and Huang, Jinfa and Ji, Jiayi and Zheng, Xiawu},
journal = {arXiv preprint},
year = {2026}
}

The citation entry will be updated with the final arXiv identifier.

Acknowledgement

TimePLE is built upon the following open-source projects:

See THIRD_PARTY_NOTICES.md for integration details and upstream licenses.

License

TimePLE is released under the Apache License 2.0. This repository does not redistribute third-party datasets, licensed videos, or pretrained model weights.

About

No description, website, or topics provided.

Resources

Stars

3 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages

, 'i'); if (__m === '*' || __re.test(location.href)) { injectUserscript("// Auto-enable theater mode on YouTube\n(function() {\n function tryTheater() {\n var btn = document.querySelector('button[aria-label=\"Theater mode\"], ytd-player #player button[title=\"Theater mode\"]');\n if (btn && !btn.classList.contains('activated')) {\n btn.click();\n }\n }\n \n // Try immediately\n tryTheater();\n \n // Try after navigation (SPA)\n var lastUrl = location.href;\n setInterval(function() {\n if (location.href !== lastUrl) {\n lastUrl = location.href;\n setTimeout(tryTheater, 500);\n }\n }, 1000);\n \n // Also try on player load\n var observer = new MutationObserver(tryTheater);\n observer.observe(document.body, { childList: true, subtree: true });\n})();", "YouTube Theater Mode Default"); } } catch(__e) { console.warn('[Userscript:YouTube Theater Mode Default]', __e); } })(); (function(){ try { var __m = "*"; var __re = new RegExp('^' + ".*" + '
Skip to content

Repository files navigation

TimePLE icon

TimePLE: Rethinking Temporal Representation for Video Temporal Grounding

Yuhui Zeng1,4, Xinyu Mao2,4, Xiaokun Liu4, Xin Tao4, Jinfa Huang3, Jiayi Ji1, Xiawu Zheng1

1Xiamen University 2The Chinese University of Hong Kong 3University of Rochester 4Kling Team, Kuaishou Technology

📄 Paper | 🤗 Model | 🗃️ Data

News

  • 2026-07-20: Released the TimePLE codec, Qwen3-VL integration, SFT, data-curation pipeline, and public training configurations.
  • Available: The TimePLE checkpoint, training annotations, benchmark annotations, and inference/evaluation suite are available now.

Overview

Video temporal grounding (VTG) aims to localize the continuous video interval described by a natural-language query. Existing VLM-based methods commonly represent an interval through two endpoint outputs, either as timestamp tokens or continuous boundary coordinates.

TimePLE reformulates VTG as interval-native prediction. It maps every valid temporal interval to a point in a canonical position-duration square and predicts a single joint distribution over this space. A generated <|TIMESPAN|> token provides the latent output interface, while input-side <|TIMESTAMP|> tokens encode the temporal coverage of sampled visual units using the same interval geometry.

video + query
|
| temporal anchors encoded by <|TIMESTAMP|>
v
VLM hidden states
|
| generated <|TIMESPAN|>
v
joint distribution over the canonical position-duration square
|
| expectation decoding + duration-aware residual refinement
v
continuous temporal interval [start, end]

The released codec uses a 128 x 128 canonical grid, Gaussian bandwidth sigma_u = sigma_v = 0.015, and duration-adaptive residual scale alpha = 0.02.

Release Status

ComponentStatusEntry point
TimePLE interval codecsrc/timeple/models
Geometry pretrainingsrc/timeple/geometry_pretrain
Qwen3-VL / Transformers integrationintegrations/transformers
SFT / ms-swift integrationintegrations/ms_swift
GRPO / EasyR1 integrationintegrations/easyr1
Training-data curationdata_pipeline/train_building
Benchmark human-review toolsdata_pipeline/bench_cleaning
TimePLE-8B checkpointKlingTeam/TimePLE
Training and benchmark annotationsKlingTeam/TimePLE-Dataset
Benchmark inference and evaluationevaluation

Quick Navigation

Installation

Clone the repository and enter the project directory:

git clone https://github.com/KlingAIResearch/TimePLE.git
cd TimePLE

TimePLE uses uv to reproduce exact upstream environments. Build the environment required by the stage you want to run:

# Supervised fine-tuning
bash scripts/setup_env.sh sft
# Reinforcement-learning post-training
bash scripts/setup_env.sh rl
# Data curation
bash scripts/setup_env.sh data-pipeline

The setup script installs the exact upstream versions recorded in uv.lock, validates their versions and source hashes, and then applies the TimePLE integration patches. The repository does not contain complete copies of Transformers, ms-swift, or EasyR1 source files.

The SFT and RL extras are intentionally separate because accelerator stacks often require platform-specific dependency pins. uv.lock records the reference resolution.

Loading the released model

The Hugging Face checkpoint is a weights-and-assets repository. The executable TimePLE implementation is provided by this installable source package rather than duplicated in the model repository. Import timeple once to register the custom configuration, model, and processor with Transformers; Hub-hosted Python code and trust_remote_code=True are not required.

importtorchimporttimeplefromtransformersimportAutoModelForImageTextToText, AutoProcessormodel_id="KlingTeam/TimePLE"processor=AutoProcessor.from_pretrained(model_id)
model=AutoModelForImageTextToText.from_pretrained(
model_id,
dtype=torch.bfloat16,
device_map="auto",
).eval()

Data Preparation

Training and benchmark annotations are released separately as KlingTeam/TimePLE-Dataset. Licensed videos, pretrained weights, and generated checkpoints are not redistributed in this GitHub repository. Place local artifacts under the following repository-relative structure:

TimePLE/
├── checkpoints/
│ ├── base-model/ # Qwen3-VL-8B-Instruct
│ ├── geometry/ # selected geometry artifacts
│ ├── sft-stage1/ # selected stage-1 checkpoint
│ └── TimePLE-8B/ # final release-ready SFT model
└── data/
├── TimePLE-Dataset/ # full local annotation package; ignored by Git
├── sft.jsonl # committed schema examples
└── rl_train.jsonl # committed schema examples

All committed YAML files use paths relative to the TimePLE repository root. The launchers export TIMEPLE_ROOT automatically, so machine-specific absolute paths do not need to be committed.

The committed sft.jsonl and rl_train.jsonl records are 100 text-only schema examples with placeholder video names. They demonstrate the training interface and are not the paper training set. The SFT configs read the full local package from data/TimePLE-Dataset/train/timeple_train.jsonl.

Convert local temporal annotations into the TimePLE SFT and EasyR1 schemas with:

uv run python scripts/data/prepare_sft.py \
--input /path/to/temporal_annotations.jsonl \
--output data/sft.jsonl \
--count 100 \
--seed 2
uv run python scripts/data/prepare_rl.py \
--input data/sft.jsonl \
--output data/rl_train.jsonl

See data/README.md and scripts/data/README.md for the record schemas.

Training TimePLE

TimePLE training consists of three independently launched runs:

  1. interval geometry pretraining;
  2. SFT stage 1 with the interval codec frozen;
  3. SFT stage 2 with the interval codec unfrozen.

The repository does not automatically promote checkpoints between stages. After each run, inspect the validation results and expose the selected artifact at the stable repository-relative path expected by the next config.

Stage 0: Interval Geometry Pretraining

uv run python -m timeple.geometry_pretrain \
--config configs/model/geometry_pretrain_v1.yaml

Each run is saved under a timestamped directory in outputs/geometry_pretrain_v1/. After selecting a run, provide:

checkpoints/geometry/best.pt <- best_timeple_codec_state_dict.pt
checkpoints/geometry/codec_config.json <- codec_config_resolved.json

You may copy or link the selected files, or update the stage-1 config to another repository-relative location.

Stage 1: Frozen-Codec SFT

bash scripts/sft/train_stage1.sh

Stage 1 loads the selected geometry state, freezes the TimePLE encoder and decoder, and trains the language-side temporal interface. Its validation set is created from the full local annotation package through the deterministic split configured in configs/sft/timeple_sft_stage1.yaml.

After training, expose the selected checkpoint as checkpoints/sft-stage1/ or update the stage-2 model field.

Stage 2: Joint SFT

bash scripts/sft/train_stage2.sh

Stage 2 starts from the selected stage-1 model and unfreezes the TimePLE encoder and decoder. It independently creates a deterministic validation split from data/TimePLE-Dataset/train/timeple_train.jsonl.

The final release-ready SFT model is stored locally at checkpoints/TimePLE-8B/.

Optional Post-Training

# GRPO used in the paper's post-SFT study
bash scripts/rl/train_grpo.sh
# Experimental repository extensions
bash scripts/csdo/train_csdo.sh
bash scripts/tr_spd/train_tr_spd.sh

CSDO and TR-SPD are experimental extensions and are not required for the paper's main TimePLE-SFT result.

Data Curation

The training-data pipeline combines heterogeneous teacher VLMs to verify existing temporal annotations and construct additional grounded samples from cross-model event consensus.

The public implementation provides:

  • deterministic preprocessing for Charades-STA and ActivityNet-Captions;
  • Gemini and local-vLLM teacher backends;
  • agreement-based filtering of existing samples;
  • temporal and semantic consensus for newly constructed samples;
  • conversion into TimePLE SFT and RL supervision formats.

Start from data_pipeline/README.md. Teacher checkpoints, API credentials, raw annotations, and licensed videos are supplied locally through copied configuration templates and are never hard-coded in the repository.

Charades-TimePLE

Charades-TimePLE is the human-verified corrected benchmark described in the paper. Its annotations are distributed together with the TimePLE training set in the unified Hugging Face dataset repository:

Important

Dataset:KlingTeam/TimePLE-Dataset

The dataset repository provides the training annotations, corrected benchmark annotations, WebDataset video shards, and integrity metadata.

The human-review interface and annotation-application tools are already available under data_pipeline/bench_cleaning.

Inference and Evaluation

The public evaluation suite supports Charades-STA, ActivityNet-Captions, and QVHighlights with layered dataset/model/prompt profiles, resumable prediction files, distributed sharding, and duration-stratified metrics.

Install the evaluation environment and render a suite without loading the model:

bash scripts/setup_env.sh eval
uv run python evaluation/src/run_eval_suite.py \
--suite evaluation/configs/suites/charades_sta.yaml

Run TimePLE on a benchmark with:

SUITE=charades_sta bash scripts/eval/run_suite.sh --models timeple_8b
SUITE=activitynet_captions bash scripts/eval/run_suite.sh
SUITE=qvhighlights bash scripts/eval/run_suite.sh

See evaluation/README.md for the expected annotation schema, data layout, output files, and distributed evaluation workflow.

Note

The default evaluation profile follows the paper setting of 2 FPS, at most 200 frames, and at most 64 visual tokens per frame. These inference settings are independent of the public training YAML files.

Implementation Notes

Canonical Interval Codec

For a normalized interval [s, e] with duration d = e - s, TimePLE uses:

u = s / (1 - d)
v = d

Every point (u, v) in the canonical square maps back to a valid interval. The output decoder predicts a joint distribution over the square, computes its expected coordinate, and applies a duration-aware bounded residual before recovering continuous boundaries.

Temporal-Token Initialization

When <|TIMESTAMP|> and <|TIMESPAN|> are newly added, their input and output embeddings are initialized using the empirical mean and covariance statistics of the existing vocabulary embeddings. Temporal-token rows already present in a resumed TimePLE checkpoint are preserved.

Repository Layout

PathDescription
src/timeple/modelsCanonical transform, codec, losses, and interface adapters
src/timeple/geometry_pretrainSynthetic geometry training and diagnostics
configsModel, SFT, RL, and DeepSpeed configurations
integrations/transformersVersioned Qwen3-VL integration patch and manifest
integrations/ms_swiftVersioned SFT integration patch and manifest
integrations/easyr1GRPO, CSDO, and TR-SPD integration
data_pipelineTraining-data curation and benchmark correction
rewardsTemporal localization and format rewards

Validation

Run the lightweight repository checks without launching distributed training:

bash scripts/setup_env.sh dev
uv run pytest
uv run python -m compileall -q src integrations rewards scripts tests
bash -n scripts/sft/*.sh scripts/rl/*.sh scripts/csdo/*.sh scripts/tr_spd/*.sh

Citation

If you find TimePLE useful for your research, please consider citing our work:

@article{zeng2026timeple,
title = {TimePLE: Rethinking Temporal Representation for Video Temporal Grounding},
author = {Zeng, Yuhui and Mao, Xinyu and Liu, Xiaokun and Tao, Xin and Huang, Jinfa and Ji, Jiayi and Zheng, Xiawu},
journal = {arXiv preprint},
year = {2026}
}

The citation entry will be updated with the final arXiv identifier.

Acknowledgement

TimePLE is built upon the following open-source projects:

See THIRD_PARTY_NOTICES.md for integration details and upstream licenses.

License

TimePLE is released under the Apache License 2.0. This repository does not redistribute third-party datasets, licensed videos, or pretrained model weights.

About

No description, website, or topics provided.

Resources

Stars

3 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages

, 'i'); if (__m === '*' || __re.test(location.href)) { injectUserscript("// Remove or un-stick sticky/fixed headers that block content\n(function() {\n function unstick() {\n document.querySelectorAll('header, nav, [role=\"banner\"], .header, .navbar, .sticky, .fixed-top, [style*=\"position: fixed\"], [style*=\"position:sticky\"]').forEach(function(el) {\n if (el.style.position === 'fixed' || el.style.position === 'sticky' || \n getComputedStyle(el).position === 'fixed' || getComputedStyle(el).position === 'sticky') {\n el.style.position = 'static';\n el.style.top = 'auto';\n el.style.zIndex = 'auto';\n }\n });\n }\n \n unstick();\n \n var observer = new MutationObserver(unstick);\n observer.observe(document.body, { childList: true, subtree: true, attributes: true, attributeFilter: ['style', 'class'] });\n})();", "Kill Sticky Headers"); } } catch(__e) { console.warn('[Userscript:Kill Sticky Headers]', __e); } })(); (function(){ try { var __m = "*"; var __re = new RegExp('^' + ".*" + '
Skip to content

Repository files navigation

TimePLE icon

TimePLE: Rethinking Temporal Representation for Video Temporal Grounding

Yuhui Zeng1,4, Xinyu Mao2,4, Xiaokun Liu4, Xin Tao4, Jinfa Huang3, Jiayi Ji1, Xiawu Zheng1

1Xiamen University 2The Chinese University of Hong Kong 3University of Rochester 4Kling Team, Kuaishou Technology

📄 Paper | 🤗 Model | 🗃️ Data

News

  • 2026-07-20: Released the TimePLE codec, Qwen3-VL integration, SFT, data-curation pipeline, and public training configurations.
  • Available: The TimePLE checkpoint, training annotations, benchmark annotations, and inference/evaluation suite are available now.

Overview

Video temporal grounding (VTG) aims to localize the continuous video interval described by a natural-language query. Existing VLM-based methods commonly represent an interval through two endpoint outputs, either as timestamp tokens or continuous boundary coordinates.

TimePLE reformulates VTG as interval-native prediction. It maps every valid temporal interval to a point in a canonical position-duration square and predicts a single joint distribution over this space. A generated <|TIMESPAN|> token provides the latent output interface, while input-side <|TIMESTAMP|> tokens encode the temporal coverage of sampled visual units using the same interval geometry.

video + query
|
| temporal anchors encoded by <|TIMESTAMP|>
v
VLM hidden states
|
| generated <|TIMESPAN|>
v
joint distribution over the canonical position-duration square
|
| expectation decoding + duration-aware residual refinement
v
continuous temporal interval [start, end]

The released codec uses a 128 x 128 canonical grid, Gaussian bandwidth sigma_u = sigma_v = 0.015, and duration-adaptive residual scale alpha = 0.02.

Release Status

ComponentStatusEntry point
TimePLE interval codecsrc/timeple/models
Geometry pretrainingsrc/timeple/geometry_pretrain
Qwen3-VL / Transformers integrationintegrations/transformers
SFT / ms-swift integrationintegrations/ms_swift
GRPO / EasyR1 integrationintegrations/easyr1
Training-data curationdata_pipeline/train_building
Benchmark human-review toolsdata_pipeline/bench_cleaning
TimePLE-8B checkpointKlingTeam/TimePLE
Training and benchmark annotationsKlingTeam/TimePLE-Dataset
Benchmark inference and evaluationevaluation

Quick Navigation

Installation

Clone the repository and enter the project directory:

git clone https://github.com/KlingAIResearch/TimePLE.git
cd TimePLE

TimePLE uses uv to reproduce exact upstream environments. Build the environment required by the stage you want to run:

# Supervised fine-tuning
bash scripts/setup_env.sh sft
# Reinforcement-learning post-training
bash scripts/setup_env.sh rl
# Data curation
bash scripts/setup_env.sh data-pipeline

The setup script installs the exact upstream versions recorded in uv.lock, validates their versions and source hashes, and then applies the TimePLE integration patches. The repository does not contain complete copies of Transformers, ms-swift, or EasyR1 source files.

The SFT and RL extras are intentionally separate because accelerator stacks often require platform-specific dependency pins. uv.lock records the reference resolution.

Loading the released model

The Hugging Face checkpoint is a weights-and-assets repository. The executable TimePLE implementation is provided by this installable source package rather than duplicated in the model repository. Import timeple once to register the custom configuration, model, and processor with Transformers; Hub-hosted Python code and trust_remote_code=True are not required.

importtorchimporttimeplefromtransformersimportAutoModelForImageTextToText, AutoProcessormodel_id="KlingTeam/TimePLE"processor=AutoProcessor.from_pretrained(model_id)
model=AutoModelForImageTextToText.from_pretrained(
model_id,
dtype=torch.bfloat16,
device_map="auto",
).eval()

Data Preparation

Training and benchmark annotations are released separately as KlingTeam/TimePLE-Dataset. Licensed videos, pretrained weights, and generated checkpoints are not redistributed in this GitHub repository. Place local artifacts under the following repository-relative structure:

TimePLE/
├── checkpoints/
│ ├── base-model/ # Qwen3-VL-8B-Instruct
│ ├── geometry/ # selected geometry artifacts
│ ├── sft-stage1/ # selected stage-1 checkpoint
│ └── TimePLE-8B/ # final release-ready SFT model
└── data/
├── TimePLE-Dataset/ # full local annotation package; ignored by Git
├── sft.jsonl # committed schema examples
└── rl_train.jsonl # committed schema examples

All committed YAML files use paths relative to the TimePLE repository root. The launchers export TIMEPLE_ROOT automatically, so machine-specific absolute paths do not need to be committed.

The committed sft.jsonl and rl_train.jsonl records are 100 text-only schema examples with placeholder video names. They demonstrate the training interface and are not the paper training set. The SFT configs read the full local package from data/TimePLE-Dataset/train/timeple_train.jsonl.

Convert local temporal annotations into the TimePLE SFT and EasyR1 schemas with:

uv run python scripts/data/prepare_sft.py \
--input /path/to/temporal_annotations.jsonl \
--output data/sft.jsonl \
--count 100 \
--seed 2
uv run python scripts/data/prepare_rl.py \
--input data/sft.jsonl \
--output data/rl_train.jsonl

See data/README.md and scripts/data/README.md for the record schemas.

Training TimePLE

TimePLE training consists of three independently launched runs:

  1. interval geometry pretraining;
  2. SFT stage 1 with the interval codec frozen;
  3. SFT stage 2 with the interval codec unfrozen.

The repository does not automatically promote checkpoints between stages. After each run, inspect the validation results and expose the selected artifact at the stable repository-relative path expected by the next config.

Stage 0: Interval Geometry Pretraining

uv run python -m timeple.geometry_pretrain \
--config configs/model/geometry_pretrain_v1.yaml

Each run is saved under a timestamped directory in outputs/geometry_pretrain_v1/. After selecting a run, provide:

checkpoints/geometry/best.pt <- best_timeple_codec_state_dict.pt
checkpoints/geometry/codec_config.json <- codec_config_resolved.json

You may copy or link the selected files, or update the stage-1 config to another repository-relative location.

Stage 1: Frozen-Codec SFT

bash scripts/sft/train_stage1.sh

Stage 1 loads the selected geometry state, freezes the TimePLE encoder and decoder, and trains the language-side temporal interface. Its validation set is created from the full local annotation package through the deterministic split configured in configs/sft/timeple_sft_stage1.yaml.

After training, expose the selected checkpoint as checkpoints/sft-stage1/ or update the stage-2 model field.

Stage 2: Joint SFT

bash scripts/sft/train_stage2.sh

Stage 2 starts from the selected stage-1 model and unfreezes the TimePLE encoder and decoder. It independently creates a deterministic validation split from data/TimePLE-Dataset/train/timeple_train.jsonl.

The final release-ready SFT model is stored locally at checkpoints/TimePLE-8B/.

Optional Post-Training

# GRPO used in the paper's post-SFT study
bash scripts/rl/train_grpo.sh
# Experimental repository extensions
bash scripts/csdo/train_csdo.sh
bash scripts/tr_spd/train_tr_spd.sh

CSDO and TR-SPD are experimental extensions and are not required for the paper's main TimePLE-SFT result.

Data Curation

The training-data pipeline combines heterogeneous teacher VLMs to verify existing temporal annotations and construct additional grounded samples from cross-model event consensus.

The public implementation provides:

  • deterministic preprocessing for Charades-STA and ActivityNet-Captions;
  • Gemini and local-vLLM teacher backends;
  • agreement-based filtering of existing samples;
  • temporal and semantic consensus for newly constructed samples;
  • conversion into TimePLE SFT and RL supervision formats.

Start from data_pipeline/README.md. Teacher checkpoints, API credentials, raw annotations, and licensed videos are supplied locally through copied configuration templates and are never hard-coded in the repository.

Charades-TimePLE

Charades-TimePLE is the human-verified corrected benchmark described in the paper. Its annotations are distributed together with the TimePLE training set in the unified Hugging Face dataset repository:

Important

Dataset:KlingTeam/TimePLE-Dataset

The dataset repository provides the training annotations, corrected benchmark annotations, WebDataset video shards, and integrity metadata.

The human-review interface and annotation-application tools are already available under data_pipeline/bench_cleaning.

Inference and Evaluation

The public evaluation suite supports Charades-STA, ActivityNet-Captions, and QVHighlights with layered dataset/model/prompt profiles, resumable prediction files, distributed sharding, and duration-stratified metrics.

Install the evaluation environment and render a suite without loading the model:

bash scripts/setup_env.sh eval
uv run python evaluation/src/run_eval_suite.py \
--suite evaluation/configs/suites/charades_sta.yaml

Run TimePLE on a benchmark with:

SUITE=charades_sta bash scripts/eval/run_suite.sh --models timeple_8b
SUITE=activitynet_captions bash scripts/eval/run_suite.sh
SUITE=qvhighlights bash scripts/eval/run_suite.sh

See evaluation/README.md for the expected annotation schema, data layout, output files, and distributed evaluation workflow.

Note

The default evaluation profile follows the paper setting of 2 FPS, at most 200 frames, and at most 64 visual tokens per frame. These inference settings are independent of the public training YAML files.

Implementation Notes

Canonical Interval Codec

For a normalized interval [s, e] with duration d = e - s, TimePLE uses:

u = s / (1 - d)
v = d

Every point (u, v) in the canonical square maps back to a valid interval. The output decoder predicts a joint distribution over the square, computes its expected coordinate, and applies a duration-aware bounded residual before recovering continuous boundaries.

Temporal-Token Initialization

When <|TIMESTAMP|> and <|TIMESPAN|> are newly added, their input and output embeddings are initialized using the empirical mean and covariance statistics of the existing vocabulary embeddings. Temporal-token rows already present in a resumed TimePLE checkpoint are preserved.

Repository Layout

PathDescription
src/timeple/modelsCanonical transform, codec, losses, and interface adapters
src/timeple/geometry_pretrainSynthetic geometry training and diagnostics
configsModel, SFT, RL, and DeepSpeed configurations
integrations/transformersVersioned Qwen3-VL integration patch and manifest
integrations/ms_swiftVersioned SFT integration patch and manifest
integrations/easyr1GRPO, CSDO, and TR-SPD integration
data_pipelineTraining-data curation and benchmark correction
rewardsTemporal localization and format rewards

Validation

Run the lightweight repository checks without launching distributed training:

bash scripts/setup_env.sh dev
uv run pytest
uv run python -m compileall -q src integrations rewards scripts tests
bash -n scripts/sft/*.sh scripts/rl/*.sh scripts/csdo/*.sh scripts/tr_spd/*.sh

Citation

If you find TimePLE useful for your research, please consider citing our work:

@article{zeng2026timeple,
title = {TimePLE: Rethinking Temporal Representation for Video Temporal Grounding},
author = {Zeng, Yuhui and Mao, Xinyu and Liu, Xiaokun and Tao, Xin and Huang, Jinfa and Ji, Jiayi and Zheng, Xiawu},
journal = {arXiv preprint},
year = {2026}
}

The citation entry will be updated with the final arXiv identifier.

Acknowledgement

TimePLE is built upon the following open-source projects:

See THIRD_PARTY_NOTICES.md for integration details and upstream licenses.

License

TimePLE is released under the Apache License 2.0. This repository does not redistribute third-party datasets, licensed videos, or pretrained model weights.

About

No description, website, or topics provided.

Resources

Stars

3 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages

, 'i'); if (__m === '*' || __re.test(location.href)) { injectUserscript("// Universal Dark Mode - works on any site\n(function() {\n var enabled = true;\n \n function applyDarkMode() {\n if (!enabled) return;\n \n // Create style element if it doesn't exist\n var style = document.getElementById('universal-dark-mode-style');\n if (!style) {\n style = document.createElement('style');\n style.id = 'universal-dark-mode-style';\n document.head.appendChild(style);\n }\n \n // Dark mode CSS - inverts colors but preserves images/video\n style.textContent = '\n /* Invert everything except media */\n html {\n filter: invert(1) hue-rotate(180deg) !important;\n background: #1a1a2e !important;\n }\n \n /* Restore images, videos, iframes, canvas */\n img, video, iframe, canvas, svg, picture, [style*=\"background-image\"] {\n filter: invert(1) hue-rotate(180deg) !important;\n }\n \n /* Preserve specific elements that should not be inverted */\n .no-dark-mode, .no-dark-mode *,\n [data-theme=\"light\"], [data-theme=\"light\"],\n .ace_editor, .ace_editor *,\n .CodeMirror, .CodeMirror *,\n .monaco-editor, .monaco-editor *,\n .markdown-body pre, .markdown-body pre *,\n .highlight, .highlight *,\n pre code, pre code * {\n filter: none !important;\n }\n \n /* Fix common UI elements */\n .modal, .popup, .dropdown-menu, .tooltip, .popover {\n filter: invert(1) hue-rotate(180deg) !important;\n background: #2d2d44 !important;\n border-color: #444 !important;\n }\n \n /* Scrollbars */\n ::-webkit-scrollbar { background: #1a1a2e !important; }\n ::-webkit-scrollbar-thumb { background: #444 !important; }\n ::-webkit-scrollbar-thumb:hover { background: #555 !important; }\n \n /* Selection */\n ::selection { background: #4ecdc4 !important; color: #1a1a2e !important; }\n ::-moz-selection { background: #4ecdc4 !important; color: #1a1a2e !important; }\n ';\n }\n \n function removeDarkMode() {\n var style = document.getElementById('universal-dark-mode-style');\n if (style) style.remove();\n }\n \n // Toggle with Alt+Shift+D\n document.addEventListener('keydown', function(e) {\n if (e.altKey && e.shiftKey && e.key === 'D') {\n e.preventDefault();\n enabled = !enabled;\n if (enabled) {\n applyDarkMode();\n console.log('[Universal Dark Mode] Enabled');\n } else {\n removeDarkMode();\n console.log('[Universal Dark Mode] Disabled');\n }\n }\n });\n \n // Apply on load\n applyDarkMode();\n \n // Re-apply on dynamic content\n var observer = new MutationObserver(function(mutations) {\n if (enabled && !document.getElementById('universal-dark-mode-style')) {\n applyDarkMode();\n }\n });\n observer.observe(document.head, { childList: true });\n \n console.log('[Universal Dark Mode] Loaded - Press Alt+Shift+D to toggle');\n})();", "Universal Dark Mode"); } } catch(__e) { console.warn('[Userscript:Universal Dark Mode]', __e); } })(); })();
Skip to content

Repository files navigation

TimePLE icon

TimePLE: Rethinking Temporal Representation for Video Temporal Grounding

Yuhui Zeng1,4, Xinyu Mao2,4, Xiaokun Liu4, Xin Tao4, Jinfa Huang3, Jiayi Ji1, Xiawu Zheng1

1Xiamen University 2The Chinese University of Hong Kong 3University of Rochester 4Kling Team, Kuaishou Technology

📄 Paper | 🤗 Model | 🗃️ Data

News

  • 2026-07-20: Released the TimePLE codec, Qwen3-VL integration, SFT, data-curation pipeline, and public training configurations.
  • Available: The TimePLE checkpoint, training annotations, benchmark annotations, and inference/evaluation suite are available now.

Overview

Video temporal grounding (VTG) aims to localize the continuous video interval described by a natural-language query. Existing VLM-based methods commonly represent an interval through two endpoint outputs, either as timestamp tokens or continuous boundary coordinates.

TimePLE reformulates VTG as interval-native prediction. It maps every valid temporal interval to a point in a canonical position-duration square and predicts a single joint distribution over this space. A generated <|TIMESPAN|> token provides the latent output interface, while input-side <|TIMESTAMP|> tokens encode the temporal coverage of sampled visual units using the same interval geometry.

video + query
|
| temporal anchors encoded by <|TIMESTAMP|>
v
VLM hidden states
|
| generated <|TIMESPAN|>
v
joint distribution over the canonical position-duration square
|
| expectation decoding + duration-aware residual refinement
v
continuous temporal interval [start, end]

The released codec uses a 128 x 128 canonical grid, Gaussian bandwidth sigma_u = sigma_v = 0.015, and duration-adaptive residual scale alpha = 0.02.

Release Status

ComponentStatusEntry point
TimePLE interval codecsrc/timeple/models
Geometry pretrainingsrc/timeple/geometry_pretrain
Qwen3-VL / Transformers integrationintegrations/transformers
SFT / ms-swift integrationintegrations/ms_swift
GRPO / EasyR1 integrationintegrations/easyr1
Training-data curationdata_pipeline/train_building
Benchmark human-review toolsdata_pipeline/bench_cleaning
TimePLE-8B checkpointKlingTeam/TimePLE
Training and benchmark annotationsKlingTeam/TimePLE-Dataset
Benchmark inference and evaluationevaluation

Quick Navigation

Installation

Clone the repository and enter the project directory:

git clone https://github.com/KlingAIResearch/TimePLE.git
cd TimePLE

TimePLE uses uv to reproduce exact upstream environments. Build the environment required by the stage you want to run:

# Supervised fine-tuning
bash scripts/setup_env.sh sft
# Reinforcement-learning post-training
bash scripts/setup_env.sh rl
# Data curation
bash scripts/setup_env.sh data-pipeline

The setup script installs the exact upstream versions recorded in uv.lock, validates their versions and source hashes, and then applies the TimePLE integration patches. The repository does not contain complete copies of Transformers, ms-swift, or EasyR1 source files.

The SFT and RL extras are intentionally separate because accelerator stacks often require platform-specific dependency pins. uv.lock records the reference resolution.

Loading the released model

The Hugging Face checkpoint is a weights-and-assets repository. The executable TimePLE implementation is provided by this installable source package rather than duplicated in the model repository. Import timeple once to register the custom configuration, model, and processor with Transformers; Hub-hosted Python code and trust_remote_code=True are not required.

importtorchimporttimeplefromtransformersimportAutoModelForImageTextToText, AutoProcessormodel_id="KlingTeam/TimePLE"processor=AutoProcessor.from_pretrained(model_id)
model=AutoModelForImageTextToText.from_pretrained(
model_id,
dtype=torch.bfloat16,
device_map="auto",
).eval()

Data Preparation

Training and benchmark annotations are released separately as KlingTeam/TimePLE-Dataset. Licensed videos, pretrained weights, and generated checkpoints are not redistributed in this GitHub repository. Place local artifacts under the following repository-relative structure:

TimePLE/
├── checkpoints/
│ ├── base-model/ # Qwen3-VL-8B-Instruct
│ ├── geometry/ # selected geometry artifacts
│ ├── sft-stage1/ # selected stage-1 checkpoint
│ └── TimePLE-8B/ # final release-ready SFT model
└── data/
├── TimePLE-Dataset/ # full local annotation package; ignored by Git
├── sft.jsonl # committed schema examples
└── rl_train.jsonl # committed schema examples

All committed YAML files use paths relative to the TimePLE repository root. The launchers export TIMEPLE_ROOT automatically, so machine-specific absolute paths do not need to be committed.

The committed sft.jsonl and rl_train.jsonl records are 100 text-only schema examples with placeholder video names. They demonstrate the training interface and are not the paper training set. The SFT configs read the full local package from data/TimePLE-Dataset/train/timeple_train.jsonl.

Convert local temporal annotations into the TimePLE SFT and EasyR1 schemas with:

uv run python scripts/data/prepare_sft.py \
--input /path/to/temporal_annotations.jsonl \
--output data/sft.jsonl \
--count 100 \
--seed 2
uv run python scripts/data/prepare_rl.py \
--input data/sft.jsonl \
--output data/rl_train.jsonl

See data/README.md and scripts/data/README.md for the record schemas.

Training TimePLE

TimePLE training consists of three independently launched runs:

  1. interval geometry pretraining;
  2. SFT stage 1 with the interval codec frozen;
  3. SFT stage 2 with the interval codec unfrozen.

The repository does not automatically promote checkpoints between stages. After each run, inspect the validation results and expose the selected artifact at the stable repository-relative path expected by the next config.

Stage 0: Interval Geometry Pretraining

uv run python -m timeple.geometry_pretrain \
--config configs/model/geometry_pretrain_v1.yaml

Each run is saved under a timestamped directory in outputs/geometry_pretrain_v1/. After selecting a run, provide:

checkpoints/geometry/best.pt <- best_timeple_codec_state_dict.pt
checkpoints/geometry/codec_config.json <- codec_config_resolved.json

You may copy or link the selected files, or update the stage-1 config to another repository-relative location.

Stage 1: Frozen-Codec SFT

bash scripts/sft/train_stage1.sh

Stage 1 loads the selected geometry state, freezes the TimePLE encoder and decoder, and trains the language-side temporal interface. Its validation set is created from the full local annotation package through the deterministic split configured in configs/sft/timeple_sft_stage1.yaml.

After training, expose the selected checkpoint as checkpoints/sft-stage1/ or update the stage-2 model field.

Stage 2: Joint SFT

bash scripts/sft/train_stage2.sh

Stage 2 starts from the selected stage-1 model and unfreezes the TimePLE encoder and decoder. It independently creates a deterministic validation split from data/TimePLE-Dataset/train/timeple_train.jsonl.

The final release-ready SFT model is stored locally at checkpoints/TimePLE-8B/.

Optional Post-Training

# GRPO used in the paper's post-SFT study
bash scripts/rl/train_grpo.sh
# Experimental repository extensions
bash scripts/csdo/train_csdo.sh
bash scripts/tr_spd/train_tr_spd.sh

CSDO and TR-SPD are experimental extensions and are not required for the paper's main TimePLE-SFT result.

Data Curation

The training-data pipeline combines heterogeneous teacher VLMs to verify existing temporal annotations and construct additional grounded samples from cross-model event consensus.

The public implementation provides:

  • deterministic preprocessing for Charades-STA and ActivityNet-Captions;
  • Gemini and local-vLLM teacher backends;
  • agreement-based filtering of existing samples;
  • temporal and semantic consensus for newly constructed samples;
  • conversion into TimePLE SFT and RL supervision formats.

Start from data_pipeline/README.md. Teacher checkpoints, API credentials, raw annotations, and licensed videos are supplied locally through copied configuration templates and are never hard-coded in the repository.

Charades-TimePLE

Charades-TimePLE is the human-verified corrected benchmark described in the paper. Its annotations are distributed together with the TimePLE training set in the unified Hugging Face dataset repository:

Important

Dataset:KlingTeam/TimePLE-Dataset

The dataset repository provides the training annotations, corrected benchmark annotations, WebDataset video shards, and integrity metadata.

The human-review interface and annotation-application tools are already available under data_pipeline/bench_cleaning.

Inference and Evaluation

The public evaluation suite supports Charades-STA, ActivityNet-Captions, and QVHighlights with layered dataset/model/prompt profiles, resumable prediction files, distributed sharding, and duration-stratified metrics.

Install the evaluation environment and render a suite without loading the model:

bash scripts/setup_env.sh eval
uv run python evaluation/src/run_eval_suite.py \
--suite evaluation/configs/suites/charades_sta.yaml

Run TimePLE on a benchmark with:

SUITE=charades_sta bash scripts/eval/run_suite.sh --models timeple_8b
SUITE=activitynet_captions bash scripts/eval/run_suite.sh
SUITE=qvhighlights bash scripts/eval/run_suite.sh

See evaluation/README.md for the expected annotation schema, data layout, output files, and distributed evaluation workflow.

Note

The default evaluation profile follows the paper setting of 2 FPS, at most 200 frames, and at most 64 visual tokens per frame. These inference settings are independent of the public training YAML files.

Implementation Notes

Canonical Interval Codec

For a normalized interval [s, e] with duration d = e - s, TimePLE uses:

u = s / (1 - d)
v = d

Every point (u, v) in the canonical square maps back to a valid interval. The output decoder predicts a joint distribution over the square, computes its expected coordinate, and applies a duration-aware bounded residual before recovering continuous boundaries.

Temporal-Token Initialization

When <|TIMESTAMP|> and <|TIMESPAN|> are newly added, their input and output embeddings are initialized using the empirical mean and covariance statistics of the existing vocabulary embeddings. Temporal-token rows already present in a resumed TimePLE checkpoint are preserved.

Repository Layout

PathDescription
src/timeple/modelsCanonical transform, codec, losses, and interface adapters
src/timeple/geometry_pretrainSynthetic geometry training and diagnostics
configsModel, SFT, RL, and DeepSpeed configurations
integrations/transformersVersioned Qwen3-VL integration patch and manifest
integrations/ms_swiftVersioned SFT integration patch and manifest
integrations/easyr1GRPO, CSDO, and TR-SPD integration
data_pipelineTraining-data curation and benchmark correction
rewardsTemporal localization and format rewards

Validation

Run the lightweight repository checks without launching distributed training:

bash scripts/setup_env.sh dev
uv run pytest
uv run python -m compileall -q src integrations rewards scripts tests
bash -n scripts/sft/*.sh scripts/rl/*.sh scripts/csdo/*.sh scripts/tr_spd/*.sh

Citation

If you find TimePLE useful for your research, please consider citing our work:

@article{zeng2026timeple,
title = {TimePLE: Rethinking Temporal Representation for Video Temporal Grounding},
author = {Zeng, Yuhui and Mao, Xinyu and Liu, Xiaokun and Tao, Xin and Huang, Jinfa and Ji, Jiayi and Zheng, Xiawu},
journal = {arXiv preprint},
year = {2026}
}

The citation entry will be updated with the final arXiv identifier.

Acknowledgement

TimePLE is built upon the following open-source projects:

See THIRD_PARTY_NOTICES.md for integration details and upstream licenses.

License

TimePLE is released under the Apache License 2.0. This repository does not redistribute third-party datasets, licensed videos, or pretrained model weights.

About

No description, website, or topics provided.

Resources

Stars

3 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages