MikeMirzayanov's blog

By MikeMirzayanov, 10 months ago, In English

Hello, Codeforces!

For the new members of the community, I would like to remind you that Polygon (https://polygon.codeforces.com/) is a system developed and maintained by Codeforces for preparing programming problems. It is there that authors and coordinators develop all the problems for the rounds. Moreover, I believe a significant (large?) portion of the problems for other competitions is also developed there: various stages of ICPC, national competitions of different levels, educational problems for various courses, etc. In 2023, more than 50000 problems were prepared in Polygon (only those for which a package was compiled are counted)!

Large language models are becoming an increasingly integral part of our lives, taking over routine and monotonous tasks.

With their help, problems created in Polygon will now have fewer typos and incorrect language constructions.

We have recently implemented three features in Polygon to ease routine tasks:

  • Translation of solutions into another programming language
  • Translation of problem statements into another language
  • Advice on improving the texts of problem statements

All these features operate on request and typically take 30-120 seconds for a response from the AI service (currently, only OpenAI GPT in our case).

While waiting for translations of solutions and statements is acceptable, waiting for advice on improving text was too tiresome.

I recently developed several problems and, despite my experience in writing statements (and even having the highly recommended Grammarly plugin in my browser), the automatic advice tool for improving text helped enhance them.

Another example: I checked the working versions of the Hello 2024 problems about a day before the round started and took the time to manually launch the edit prompter. In most (almost all?) problems, it indeed suggested errors or deficiencies in English/Russian. The corrections were minor, but why leave mistakes if they can be fixed?

Indeed, such a tool can greatly improve the grammar of statements, but using it on demand was tiresome.

As a result, I implemented background processing of the problem statements to simplify and speed up the application of this feature. Now, Polygon analyzes problem statements in the background to find shortcomings. If any are found, you will see a similar block in the problem's sidebar.

This block might not appear immediately upon changing the statement, as processing a request to the AI service usually takes tens of seconds.

Clicking on the review link will open a tool for merging changes.

This is a synthetic example. I made a few typos in the statement of my old problem. I should note that even the Grammarly plugin didn't catch all of them.

I circled one of the triangles. Click on them to transfer the proposed changes (on the right) to the text of the statement (on the left). You can only transfer for a whole paragraph at a time (that's how the tool works), but you can manually correct the left if you want to transfer part of the changes or modify them.

At the bottom of the form is a Save button that will save the updated statement.

I hope that authors and coordinators will not neglect this feature and that there will now be fewer typos and language errors in statements.

I would like to note that I see no reason to worry about data leakage when processing statements with the AI service. For example, OpenAI explicitly states that data from API requests cannot be used for training: https://help.openai.com/en/articles/5722486-how-your-data-is-used-to-improve-model-performance. After all, we've been googling problem ideas for many years to ensure the problem is new. It seems to be a similar case.

However, if you are still concerned and want to explicitly disable this feature, it can be done:

  • For a problem: via the Advanced link on the General info tab.
  • In user settings: disable this feature for all new problems you create.

Thanks for reading! Stay tuned for more updates.

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

»
10 months ago, # |
  Vote: I like it +19 Vote: I do not like it

Very cool!

»
10 months ago, # |
  Vote: I like it +77 Vote: I do not like it

Fun fact:

  • Polygon: 2009-2024
  • Codeforces: 2010-2023 (still 2023 when this comment is sent lol)
»
10 months ago, # |
  Vote: I like it 0 Vote: I do not like it
  • »
    »
    10 months ago, # ^ |
      Vote: I like it 0 Vote: I do not like it

    Ah yes, just few days ago on Polygon, we were talking about how cool it is. I didn't expect we were trying out a beta feature though.

»
10 months ago, # |
Rev. 2   Vote: I like it +33 Vote: I do not like it

[the post has been edited, this comment does not make sense anymore]

  • »
    »
    10 months ago, # ^ |
    Rev. 3   Vote: I like it 0 Vote: I do not like it

    I was confused about this comment at first, but then I noticed that there is no "history" link for blogs written by MikeMirzayanov, unlike blogs written by community members, so we have no way of seeing the edit history. I wonder if this is a bug or a feature 🤔

    EDIT: I found that this blog has the option to view history. I guess it's a toggleable option, then?

»
10 months ago, # |
Rev. 6   Vote: I like it -16 Vote: I do not like it

This comment has been deleted.

»
10 months ago, # |
  Vote: I like it +47 Vote: I do not like it

This AI suggestion confuses me — do I need to add a comma before “and”? Sometimes I didn’t, and it suggested me to add; sometimes I did, but it suggested me to remove.

I’m Chinese and not familiar with English and now I’m not sure I should use “apples, bananas and grapes” or “apples, bananas, and grapes”.

»
10 months ago, # |
  Vote: I like it +15 Vote: I do not like it

»
10 months ago, # |
  Vote: I like it 0 Vote: I do not like it

It's such a happy thing to find that we're going to have a powerful tool with AI in it -- Polygon.

So thank you mike.

»
10 months ago, # |
  Vote: I like it +4 Vote: I do not like it

Cool) I would like to see a dark theme in codeforces.... Sometimes it happens, my eyes hurt at night because of the bright website.

»
10 months ago, # |
  Vote: I like it 0 Vote: I do not like it

That's great :)

»
10 months ago, # |
  Vote: I like it +28 Vote: I do not like it

Please implement so that AI can solve the problem and fully prepare it.

»
10 months ago, # |
  Vote: I like it +5 Vote: I do not like it

Are there some good tutorials on how to use polygon? Just want to try it.

»
10 months ago, # |
  Vote: I like it 0 Vote: I do not like it

cool!

»
10 months ago, # |
  Vote: I like it 0 Vote: I do not like it

Banger features from Polygon devs again!

I still love Polygon, but I still has some concern using it. I'm not sure where to ask, so I'll write it here instead. Occasionally, Polygon has zero invokers, making everything unoperational. The most reason post about this problem I can find is here https://codeforces.me/blog/entry/122626.

Just wondering, any plans to improve the system's reliability? It’s a bummer when things go unresponsive while I’m prepping my problems.

Still, huge thanks for bringing in those awesome game-changing features!

  • »
    »
    10 months ago, # ^ |
      Vote: I like it +31 Vote: I do not like it

    I've implemented a lot of changes in transport and scheduling algorithms for invokers. Now I'm monitoring the situation.

»
10 months ago, # |
  Vote: I like it 0 Vote: I do not like it

I tried to use automatic translation from Python to C++ and it's very good. Still I have found a test case (with recursive generators of infinite sequences) where it does not work at all and some cases where complexity changes from linear to quadratic. Is there a standard way to contribute the code to improve the AI algorithm?

»
10 months ago, # |
  Vote: I like it 0 Vote: I do not like it

cool

»
10 months ago, # |
  Vote: I like it 0 Vote: I do not like it

Yekjd

»
10 months ago, # |
  Vote: I like it +8 Vote: I do not like it

Going with trend!!!!!! Cool!!!