Skip to content

cross_entropy calc #18

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

DanielVyazhev
Copy link
Collaborator

Cross-entropy calculation scripts and folder/dataset

from reasoning_fine_tune.utils.seed import set_seed
from reasoning_fine_tune.utils.validation import validate_mmlu_answer

def estimate_dataset(
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

А мы бы не хотели попробовать параметризовать функцию для подсчета энтропии одного токена? Кажется, что если научить ее принимать compute_entropy_from_logits снаружи, то можно избежать дубликации кода. Что скажешь?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ну и имена полей можно тогда тоже кастомные позволит задавать: field_ans и прочее

return_dict=True
)

last_token_logits = outputs.logits[:, -1,:] # [batch_size, vocab_size]
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

А вот это прям хорошая находка! Надо нам и для подсчета single token entropy переехать на outputs.logits

@aigoncharov
Copy link
Member

А для фишки сделаешь разбивку?

@aigoncharov aigoncharov self-assigned this Aug 2, 2025
Copy link

@yndx-vyazhev yndx-vyazhev left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

add data splits and trainer_state

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants