Skip to content
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

Deepseek prover task #733

Draft
wants to merge 8 commits into
base: main
Choose a base branch
from
Draft

Deepseek prover task #733

wants to merge 8 commits into from

Conversation

plaguss
Copy link
Contributor

@plaguss plaguss commented Jun 14, 2024

Description

⚠️ WIP

This PR implements tasks to replicate the paper: DeepSeek-Prover: Advancing Theorem Proving in LLMs through Large-Scale Synthetic Data.

Note:
The prompts differ with the original implementation as most of prompt formatting is done in via the system prompt. This yielded better results while trying with Llama3 70B.

Examples

Base Example:

from distilabel.steps.tasks import DeepSeekProverAutoFormalization
from distilabel.llms.huggingface import InferenceEndpointsLLM

prover_autoformal = DeepSeekProverAutoFormalization(
    llm=InferenceEndpointsLLM(
        model_id="deepseek-ai/deepseek-math-7b-instruct",
        tokenizer_id="deepseek-ai/deepseek-math-7b-instruct",
    ),
)

Few-shot setting:

prover_autoformal = DeepSeekProverAutoFormalization(
    llm=InferenceEndpointsLLM(
        model_id="deepseek-ai/deepseek-math-7b-instruct",
        tokenizer_id="deepseek-ai/deepseek-math-7b-instruct",
    ),
    examples=[
        "theorem amc12a_2019_p21 (z : ℂ) (h₀ : z = (1 + Complex.I) / Real.sqrt 2) :\n\n((∑ k : ℤ in Finset.Icc 1 12, z ^ k ^ 2) * (∑ k : ℤ in Finset.Icc 1 12, 1 / z ^ k ^ 2)) = 36 := by\n\nsorry",
        "theorem amc12a_2015_p10 (x y : ℤ) (h₀ : 0 < y) (h₁ : y < x) (h₂ : x + y + x * y = 80) : x = 26 := by\n\nsorry"
    ]
)

Scorer:

from distilabel.steps.tasks import DeepSeekProverScorer
from distilabel.llms.huggingface import InferenceEndpointsLLM

prover_scorer = DeepSeekProverAutoFormalization(
    llm=InferenceEndpointsLLM(
        model_id="deepseek-ai/deepseek-math-7b-instruct",
        tokenizer_id="deepseek-ai/deepseek-math-7b-instruct",
    ),
)

Pending tasks:

  •  Add example in the paper section with a full pipeline (without training).

Closes #732

@plaguss plaguss self-assigned this Jun 14, 2024
@plaguss plaguss added this to the 1.3.0 milestone Jun 14, 2024
@plaguss plaguss linked an issue Jun 14, 2024 that may be closed by this pull request
@plaguss plaguss marked this pull request as draft June 14, 2024 12:14
Copy link

codspeed-hq bot commented Jun 14, 2024

CodSpeed Performance Report

Merging #733 will not alter performance

Comparing deepseek-prover (1c2d7fc) with develop (9d6a152)

Summary

✅ 1 untouched benchmarks

Base automatically changed from develop to main June 18, 2024 12:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[IMPLEMENTATION] Implement DeepSeek-Prover
1 participant