phpduke's blog

By phpduke, history, 7 months ago, In English

Meta HackerCup is unique, as it is the only place as far as I know that allows anyone to compete their AI models against top human competitors live! Without a lot of introductory blogs on how to get started competing in AI track, it becomes daunting to start & hence this blog. Received a dozen messages asking how we built a winning solution to last year's Meta Hacker Cup, will write separate post on that maybe.

A lot has changed from last year to this, thinking models are already very good at competitive programming model out of the box. This is good because it lowers bar of entry participation while pushing bar for creating a differentiated top solution.

Goal of contest is to build an automated system that generates solution to competitive programming problems WITHOUT any human intervention. That is you cannot nudge/hint your AI system leveraging your human intuitions.

Anatomy of a typical solution

A lot of the solutions/ideas can be dissected into three different parts that you can independently optimize:-

[A] Improve Zero-shot Code Generation

This includes elaborate improvised prompts (simple but effective, though it was more impactful for non-reasoning models but occasionally very helpful), or Reinforcement Fine-tuning of top models. RL Fine tuning is a winning idea, yields very strong improvements on base model but requires a budget and a coding dataset. Another idea is to search for similar problem or sub-ideas from dataset of past problems on web. Traditional way to do was RAG, but providing websearch agent/tool is simpler & promising alternative to this.

Last year, my team took efforts to build a private coding dataset called TJO-Bench of 1000 problems, a portion of which were original problems with few million code solutions. It's still unpublished and we couldn't fully leverage it to the best as we hit budget constraints due to lack of sponsorship. It was still instrumental north-star metric for us to run experiments on which ideas are working and which aren't as most online problems are already exposed to LLMs making it hard to truly test on unseen problems. Massively improved ELO of top non-reasoning models last year using this to become first div 1 Elo model.

Have a love/hate relation with RL since my research days but truth is any task where you can effectively create verifiable test environment, you can smoke that benchmark with RL. Coding & Math both fit very nicely in this context. Last year we had to write code, but thanks to OpenAI you can actually RL finetune top OpenAI models easily. For reasons I do not understand, this still less known but was one of best highlights from OpenAI's announcements last year. Top teams from OpenAI, AlphaCode in all likelihood do this step very well. Again google to learn more about Reinforcement learning, it is out of scope for this introductory blog.

Papers: https://arxiv.org/pdf/2502.06807 | https://www.science.org/doi/abs/10.1126/science.abq1158 | https://link.springer.com/chapter/10.1007/978-3-031-88714-7_21

blog if you are curious about RL in general.

[B] Scaling Generations

You can generate multiple solutions and pick the best to improve your odds to solve a problem. Original AlphaCode, OpenAI ioi-o1 approaches deployed this to hundreds of thousands generations. You are likely constrained by budget but it should be a good idea to generate 10s of solution to improve your odds. You can also provide basic meta data like providing compiler feedbacks, eliminating codes that do not pass sample test case, etc.

Papers: https://storage.googleapis.com/deepmind-media/AlphaCode2/AlphaCode2_Tech_Report.pdf

[C] Re-ranking top solution

You can use a test case generator (either deterministically or using LLMs) to create test data for problems and eliminate generations that failed, took too long to produce output, etc. to choose best generation or use LLM to pick the best. We implemented a novel idea to eliminate branching of thoughts using a RL tuned discriminator and packaged it as Guided Reasoning Chain Framework, and it yielded us massive increase in ELO of our model within our budget and allowed us to outperform top closed source models consistently over hard problems. I gave a talk on it last NeurIPS'24 but mostly removed majority of technical component as we were given very small time slot. Can write separate blog if enough people are interested to read.

Again, there are a lot more promising ideas to try out but these are few easier ones to get you started. Below is sample baseline idea for concrete understanding.

[Sample Strategy]

Build a simple multi-agent system: OptimalAgent (that is prompted to produce optimal solution), BruteforceAgent (that is prompted to produce bruteforce but correct solution redacting constraints) and TesterAgent (that is prompted to create simple low constrained unit-test cases for given problem). So for a given problem TesterAgent produces unit-test cases with low constraints and OptimalAgent produces say 20 code-solutions and BruteforceAgent produces say 1 solution-code. Run solution code generated by BruteforceAgent to produce output for unit-test cases and treat this as official correct output. Now run all 20 code-solutions generated by OptimalAgent on same unit-test and see which code matches the unit-test cases the most, pick that as the best solution.

This is a good baseline to get started with, and essentially exploits a very simple pattern that "usually" odds of generating a dumb bruteforce solution correctly is a lot higher than generating the optimal correct solution. Again you can handcraft a lot of hand-made heuristics/strategies and improve your scores, especially if you aren't applying RL-tuning.

....

Lastly there are a lot of interesting work in domain, if you find it interesting feel free to reach out to me for casual chat /discussions over DM. Best of luck if you are participating! I am open to adding a teammate for HackerCup, I will likely not be able to spend time and will be helpful if someone can help test out some of ideas.

Or wish to contribute to my side project FlamesBlue.com (lovable but more beautiful code gen for UI).

Full text and comments »

  • Vote: I like it
  • +33
  • Vote: I do not like it

By phpduke, history, 3 years ago, In English

We are looking for contest admins and problem setters for a contest series we are starting at TheJobOverflow. We are experimenting with the format and variety of problems — the contests are primarily geared toward algorithms/ideas with a lesser component of peeling multilayer observations. TJO has 6,000 users and has evaluated 10,000 solution to programming tasks this week.

What is TJO? TheJobOverflow is an Open Community Platform for interview preparation & CP. It's built and managed by alumni of IIIT Hyderabad, IIT Bombay, IIT BHU, and IIT Guwahati. Team has ICPC world finalists, IOI medalists, Math olympiad folks and also houses key people who authored math-contest Gordian Knot a few years ago ( :

Our contest series is yet to be launched, meanwhile we have compiled & tested 350 problem's Question Bank which includes latest Coding Round & Interview problems asked by Google, Facebook, Microsoft, Rubrik, Uber etc in the last 1 year. This made TheJobOverflow the first choice for Placement Preparation for all major technical colleges in India.

As part of the next phase, we will be launching our monthly Contest Series in March (difficulty Codeforces ~ div1/div2) and are looking for responsible individuals for the roles of Problem Setters and Contest Admin.

Responsibilities

  • Deliver high-quality problem ideas based on our guidelines and standards.
  • Own the publishing process from beginning to end, resolving issues and addressing feedback.
  • Create a complete test case set for problems and ensure all corner cases are covered.
  • Collaborate with admins, team members to ensure all problems are up to standards by providing and resolving constructive feedback.

Requirements

  • Minimum CodeForces Contest rating of 1900+ ( 2100+ for Contest Admins)
  • Can commit to this role for at least 3 months
  • Ability to work in a fast-paced environment with a team and deliver high-quality work on tight schedules. Proactive and self-motivated
  • Has basic graphics skills, can produce simple image/chart to help explain ideas in problem descriptions

Brownie Points

  • ACM ICPC / IOI experience is a plus
  • Past Contest admin/preparation/testing experience is a huge plus
  • CodeForces Contest rating of 2400+ is a plus

Perks

  • Agency to craft ideal contest format/tasks-type from the ground up! ( :
  • Remote Work
  • Be part of a premium community of ICPC World Finalists (shaanknight), IOI Bronze Medalist (1nikhil9) and (phpduke) from IIIT Hyderabad, IIT BHU, IIT Guwahati, and IIT Bombay, etc.
  • Work directly with the Founders of a well-funded Y-Combinator incubated startup directly.
  • Bonus for taking ownership of work beyond your duties
  • Work in an environment that feels like a family.
  • Bragging rights of building the hottest DSA/placement preparation community.

Form Link: https://forms.gle/g381dTi8q31ASeEGA

Full text and comments »

  • Vote: I like it
  • -13
  • Vote: I do not like it

By phpduke, history, 3 years ago, In English

Hmm.. Maybe, what do I know xD tourist needs to work harder, rank 1 on CF with 200 point difference isn't sufficient to impress ChatGPT xD

On a serious note, truly puzzled by the explanation of how it got there. Do we have alternative implementations (even if inferior) which support backtracking transparency?

Full text and comments »

  • Vote: I like it
  • +210
  • Vote: I do not like it

By phpduke, 8 years ago, In English

I realized a lot of people keep pursuing and learning Competitive Programming because they get addicted to Rankings & Ratings. In this blog i have tried to help you exploit your same existing mechanism and learn Machine Learning in the process while pursuing it a competitive way.

I have drawn examples from around 10 kaggle Competitions and illustrated what works and what doesn't , what is important and what is not and how much time usually it takes for each step while competing. I have also heavily linked through the blog post and it contains more than enough links for you to start competing on Kaggle or Analytics Vidhya seriously.

Link to original Blog Post on "Introduction to Competitive Machine Learning"

Also last event by Threads, Felicity'18 called "Kings of Machine Learning" is still live. There is Rs 15,000 cash prizes and 20 T-shirts up for the Grab. If you enjoyed participating in other threads events like Gordian Knot, Codecraft, Fools Programming then probably you will enjoy this too.

Full text and comments »

  • Vote: I like it
  • +118
  • Vote: I do not like it

By phpduke, history, 8 years ago, In English

Gordian Knot is a Project Euler styled contest that challenges you to untangle the intricate enigmas of mathematics. Feel free to deploy your programming skills to make your life easy. Variety of problem set is slightly different from typical Project Euler styled contests, so we hope that you find the problem set crisp and enjoyable :)

Gordian Knot belongs to same chain of technical events called Threads, which recently organized : Codecraft (on codeforces) & Fool's programming (on codechef). You can follow Threads blog on Quora too, on which we will be adding more articles soon. Presently, we have a unique system design contest called 'SysCraft' running and 'Kings of Machine Learning' lined up too.

Contest Link : https://felicity.iiit.ac.in/threads/gordian-knot/
Start Date : 25th January , 08:00 IST
Duration : 24 hours
Prizes : T-shirts for Indian residents in top 20

NOTE :

  • We will release short editorial for 5 most popular problems.
  • You can ask for hints here if you are stuck on some problems, during last few hours we will provide hints on selected problems. Others strictly refrain from discussing/commenting about problems or posting hints/solutions.

So, can you solve 24 problems in 24 hours? (We have extra bonus problems)
Get your maths and programming skills brushed up by taking on our challenge and grab one of 20 T-shirts :)

UPDATE :

  • Problem statements for P6,10,12,13 have been simplified. Please re-check.
  • Solutions for P21 have been re-judged.
  • Hint Phase begins! Ask us for hints, We wish to help you solve whole of the problemset :)
  • EXTENDED CONTEST till 8 pm today. We really want to see someone solve whole of problemset, hope you make best use of it!
  • J.T.J.L. & zimpha unlocked level-7!

RANKLIST :

  1. zimpha
  2. J.T.J.L.
  3. zeliboba
  4. rkm0959
  5. akashdeep *
  6. jtnydv25 *
  7. usaxena95 *
  8. triveni *
  9. xenny *
  10. Pokeylope
  11. hitman623 *
  12. amwat *
  13. cerberus97 *
  14. Golovanov399
  15. teja349 *
  16. djdolls
  17. Vercingetorix
  18. eyg
  19. pulkitjain41 *
  20. shubhiks1032 *

*will get T-shirts! Congratulations. It was great to see a lot of people putting most of their day to the 36hr long contest, thankyou all for that. We had to re-write problem description for clarity in few problems, sorry for the inconvenience. We hope that you enjoyed solving the problems. Feel free to pm if you have suggestions/comments.

We will be publishing 5-popular problems' editorial as promised sooner this week :)

Full text and comments »

  • Vote: I like it
  • +96
  • Vote: I do not like it

By phpduke, 11 years ago, In English

UPDATE : Its over , we will be updatting ranks soon !

This Contest is hosted here and contest will start at time . The Contest duration is kept short only 1 hour but problems are supposed to be moderately easy . If you still remember it, just to tell you it won't happen this time ;)

The problems have been set and tested by Superty , phpduke , sampriti and Jayganesh . Hope you enjoy this short but intense challenge :)

EDIT : The contest is today as the time in link says , sorry for misprint on poster , we apologize !

Full text and comments »

  • Vote: I like it
  • +8
  • Vote: I do not like it

By phpduke, 13 years ago, In English

Indian Algolist Community Cup 2013 tomorrow at http://www.iac.host-ed.me/ ! Time: 7 to 8:30 o clock as per Indian Standard Time. Contest by me will have 5 problems with such diversity in difficulty that even 'beginner/gray' coder can solve and atleast 1 question which will perspire even the 'masters/red' coders ! So do not miss !^_^! And need not mention , its open to ALL !

Full text and comments »

  • Vote: I like it
  • +5
  • Vote: I do not like it