NaNoGenMo / 2022

National Novel Generation Month, 2022 edition.
51 stars 0 forks source link

Rambling GPT-2 Philosopher #10

Open victorangeloblancada opened 1 year ago

victorangeloblancada commented 1 year ago

I'm participating this year, though I'm still figuring out what to work on.

victorangeloblancada commented 1 year ago

This is long overdue, but I'm going to try my hand at training GPT-2 on philosophy texts and get it to ramble on and on about philosophy.

victorangeloblancada commented 1 year ago

I will use the aitextgen library (https://github.com/minimaxir/aitextgen) to finetune GPT-2.

victorangeloblancada commented 1 year ago

First draft done.

Repo here: https://github.com/victorangeloblancada/nanogenmo-2022 Output here: https://github.com/victorangeloblancada/nanogenmo-2022/blob/main/story_philosophy.txt

Here are some brief, cherry-picked snippets from the output:

On loneliness:

What is the worst way to be lonely? Is there not a cry of distress?

Certainly not.

And would you then say that sorrow is the greatest good?

Certainly not.

And would you say that it is the greatest good, and that sorrow is the greatest evil?

There would not be the heaviest thing, or the heaviest thing, if you were able to express this to yourself, as I do for the sake of the multitude; and do you not say that sorrow is the greatest good? or would you say that sorrow is the greatest evil?

On so-called honest tyrants:

What if a tyrant is honest?

And if a tyrant is good for himself, if he asks what has happened to him?

And that is what you say.

And that is what you say?

When, what is it, or why is he to be a tyrant?

Because, as I do, he who is a tyrant, has the power of the law, can be the judge of the law.

And that is the reason why no one can be justly called a tyrant.

And is not this the law which bids one to be a tyrant?

And is not the law which bids one to be a legislator or ruler of all things?

Yes, that is what they say.

On the supposed craziness of death:

Why is it crazy to be dead?

Certainly.

What?

And it is a state of mind which requires of itself and of the soul; and yet it is not a state of mind which requires the whole?

Certainly.

And will it not be a state of mind which requires neither the whole or parts?

Certainly.

And will it be the whole which requires neither parts nor parts?

No, certainly not.

And is it not the whole or parts which require neither parts nor parts?

No, certainly not.

victorangeloblancada commented 1 year ago

I see another person has created a similar project here: https://infiniteconversation.com/

victorangeloblancada commented 1 year ago

I've cleaned up the tracery-generated prompts somewhat and organized the output into chapters using headings in Markdown.

I think this can be marked as complete.

Repo here: https://github.com/victorangeloblancada/nanogenmo-2022 Output here: https://github.com/victorangeloblancada/nanogenmo-2022/blob/main/story_philosophy_2.md

Here are some brief, cherry-picked snippets from the output:

What Will Happen If Literature Is Divine?

What will happen if literature is divine?

CLEINIAS: What do you mean? he said.

ATHENIAN: I should say, that it must be the greatest of all things which can be known to us; and we ought not to seek for them in order that they may know what sort of things are better than words--and now let us have a way out of them.

CLEINIAS: That would be my desire.

ATHENIAN: But there is no difficulty in seeing how wisely Hesiod spoke when he says 'the truth.'

MEGILLUS: True.

Why Is History Evil?

Why is history evil?

Yes, certainly.

And that which can be called good will be the only thing in which there cannot be such a thing as happiness; and this may be done either by means of love or necessity--and if not, then we should say to ourselves: “What do you mean?”

That is most true.

And now let us consider what sort of man ought to be.--When he has made himself worthy of all earthly things (or for his sake of pleasure), it must be virtuous also than anything else.

Can Philosophy Be Too Infuriating?

Can philosophy be too infuriating?

CLEINIAS: Certainly.

ATHENIAN: Well, then, and would you not say that this is the best thing which can be made out of a man who has no right to make use of any other person whom he does not like him? For there cannot be either such an one as Cleinias or Cebesus; but they may be said to be both wise and free from each other (compare Aristophanes).

CLEINIAS: That is very true.

ATHENIAN: And yet I suppose that we are wrong in asking whether these things should be brought into our own mind by some divine artifice--whence it will be rightly called 'truth'? Or shall we say so? Shall we say thus?

What Is The Best Way To Be History?

What is the best way to be history?

CLEINIAS: To be sure.

ATHENIAN: And we may say that there are two things, which can only be known in words and actions; one of which must be distinguished from every other thing--namely, a part of all good or bad action (when you speak of an evil soul); for example, 'If thou shouldst slay him.'

What Will Happen If Generosity Is Also Vengeance?

What will happen if generosity is also vengeance?

Certainly, he replied.

And now the reason of this may be that justice and humanity are inseparable from each other as well as they are in themselves?

I should say so.

Why do you not suppose them to depend upon one another for their own safety? Is there any thing which has a greater or less power on both sides than theirs? Do you admit it?"

"Yes," he said.

"Then we must first make ourselves masters of these things.

Why Is It Joyful To Be A King?

Why is it joyful to be a king?

Yes, certainly.

And would you not say that he has the power of making war on his own subjects and states in general? Would you admit this?

I should imagine so.

Then we must acknowledge him; but there is no difficulty in finding out what sort of war will really be best for men who are ready to fight--when they struggle against themselves by their military expeditions as well as by means of arms: or again, when they do anything else than defend themselves under pretence of defending each other's rights which ought to be secured with vigour.

What Will Happen If Treasure Is Maddening?

What will happen if treasure is maddening?

CLEINIAS: What do you mean?

ATHENIAN: I want to say, Stranger, that money and power are the same.

CLEINIAS: Certainly not.

ATHENIAN: And yet we may be wrong in asking whether there is any thing which would have been a great evil or one of them?

CLEINIAS: Exactly so.

What Is A Lover?

What is a lover?

Yes, he said.

And what do you say of him who loves no one but himself? Would you not admit him to be loved by any one in whom there is no reason for praising or blaming others? For pity and hatred are opposites; they cannot be compared with each other when the latter becomes more innocent than the former.

What Is The Best Way To Be Dead?

What is the best way to be dead? Or, again, shall we not admit that there is no reason why it should be called a good and just manner of life?

Can A King Be Too Prudent?

Can a king be too prudent?

I cannot say so, he replied.

At any rate to him who has the power of obeying his will is not only an encroachment on royal authority, but also that it may be prevented by law; for which reason there must be no other way of proceeding in such wars and convulsions than when peaceable or destructive terms are imposed upon states--when they do not agree with their own interests (for this would be just as if we could have neither liberty nor equality).

What Is The Best Way To Be Joyful?

What is the best way to be joyful?

CLEINIAS: Certainly not, Stranger.

ATHENIAN: And when you say that any one should abstain from weeping and lamenting in your sorrows utterances--whence do you admit this?

enkiv2 commented 1 year ago

I like this method (using tracery to generate prompts for a statistical text generator to answer) -- have you tried having the 'characters' trained on different corpora? (For instance, it'd be cool to see Karl Popper debate Fredrich Nietzsche and Giles Deleuze on "What is the best way to be joyful")

On Thu, Nov 17, 2022 at 9:21 AM Victor Angelo Blancada < @.***> wrote:

I've cleaned up the tracery-generated prompts somewhat and organized the output into chapters using headings in markdown.

I think this can be marked as complete.

Repo here: https://github.com/victorangeloblancada/nanogenmo-2022 Output here: https://github.com/victorangeloblancada/nanogenmo-2022/blob/main/story_philosophy.txt

Here are some brief, cherry-picked snippets from the output:

What Will Happen If Literature Is Divine?

What will happen if literature is divine?

CLEINIAS: What do you mean? he said.

ATHENIAN: I should say, that it must be the greatest of all things which can be known to us; and we ought not to seek for them in order that they may know what sort of things are better than words--and now let us have a way out of them.

CLEINIAS: That would be my desire.

ATHENIAN: But there is no difficulty in seeing how wisely Hesiod spoke when he says 'the truth.'

MEGILLUS: True.

Why Is History Evil?

Why is history evil?

Yes, certainly.

And that which can be called good will be the only thing in which there cannot be such a thing as happiness; and this may be done either by means of love or necessity--and if not, then we should say to ourselves: “What do you mean?”

That is most true.

And now let us consider what sort of man ought to be.--When he has made himself worthy of all earthly things (or for his sake of pleasure), it must be virtuous also than anything else.

Can Philosophy Be Too Infuriating?

Can philosophy be too infuriating?

CLEINIAS: Certainly.

ATHENIAN: Well, then, and would you not say that this is the best thing which can be made out of a man who has no right to make use of any other person whom he does not like him? For there cannot be either such an one as Cleinias or Cebesus; but they may be said to be both wise and free from each other (compare Aristophanes).

CLEINIAS: That is very true.

ATHENIAN: And yet I suppose that we are wrong in asking whether these things should be brought into our own mind by some divine artifice--whence it will be rightly called 'truth'? Or shall we say so? Shall we say thus?

What Is The Best Way To Be History?

What is the best way to be history?

CLEINIAS: To be sure.

ATHENIAN: And we may say that there are two things, which can only be known in words and actions; one of which must be distinguished from every other thing--namely, a part of all good or bad action (when you speak of an evil soul); for example, 'If thou shouldst slay him.'

What Will Happen If Generosity Is Also Vengeance?

What will happen if generosity is also vengeance?

Certainly, he replied.

And now the reason of this may be that justice and humanity are inseparable from each other as well as they are in themselves?

I should say so.

Why do you not suppose them to depend upon one another for their own safety? Is there any thing which has a greater or less power on both sides than theirs? Do you admit it?"

"Yes," he said.

"Then we must first make ourselves masters of these things.

Why Is It Joyful To Be A King?

Why is it joyful to be a king?

Yes, certainly.

And would you not say that he has the power of making war on his own subjects and states in general? Would you admit this?

I should imagine so.

Then we must acknowledge him; but there is no difficulty in finding out what sort of war will really be best for men who are ready to fight--when they struggle against themselves by their military expeditions as well as by means of arms: or again, when they do anything else than defend themselves under pretence of defending each other's rights which ought to be secured with vigour.

What Will Happen If Treasure Is Maddening?

What will happen if treasure is maddening?

CLEINIAS: What do you mean?

ATHENIAN: I want to say, Stranger, that money and power are the same.

CLEINIAS: Certainly not.

ATHENIAN: And yet we may be wrong in asking whether there is any thing which would have been a great evil or one of them?

CLEINIAS: Exactly so.

What Is A Lover?

What is a lover?

Yes, he said.

And what do you say of him who loves no one but himself? Would you not admit him to be loved by any one in whom there is no reason for praising or blaming others? For pity and hatred are opposites; they cannot be compared with each other when the latter becomes more innocent than the former.

What Is The Best Way To Be Dead?

What is the best way to be dead? Or, again, shall we not admit that there is no reason why it should be called a good and just manner of life?

Can A King Be Too Prudent?

Can a king be too prudent?

I cannot say so, he replied.

At any rate to him who has the power of obeying his will is not only an encroachment on royal authority, but also that it may be prevented by law; for which reason there must be no other way of proceeding in such wars and convulsions than when peaceable or destructive terms are imposed upon states--when they do not agree with their own interests (for this would be just as if we could have neither liberty nor equality).

What Is The Best Way To Be Joyful?

What is the best way to be joyful?

CLEINIAS: Certainly not, Stranger.

ATHENIAN: And when you say that any one should abstain from weeping and lamenting in your sorrows utterances--whence do you admit this?

— Reply to this email directly, view it on GitHub https://github.com/NaNoGenMo/2022/issues/10#issuecomment-1318711705, or unsubscribe https://github.com/notifications/unsubscribe-auth/AADXUGLDEY4DHRHHEJTU5QDWIY5QPANCNFSM6AAAAAARTTU7H4 . You are receiving this because you are subscribed to this thread.Message ID: @.***>

victorangeloblancada commented 1 year ago

I like this method (using tracery to generate prompts for a statistical text generator to answer) -- have you tried having the 'characters' trained on different corpora? (For instance, it'd be cool to see Karl Popper debate Fredrich Nietzsche and Giles Deleuze on "What is the best way to be joyful")

Thanks a lot for the feedback - I appreciate it!

Yes, I gave that some thought but it all boiled down to availability of data and compute to train the models, specifically:

  1. It took me some time to finetune GPT-2 on different philosophers.
  2. To emulate a debate, I'd ideally need a dataset with clearly marked dialogue. I was fortunate to have this with Plato (hence the sections with the Athenian debating Cleinias), but I'm not sure if I can find it for others. As an aside, GPT-2 is designed to complete text instead of formulating responses - if I had more time, I'd like to train a model that does this.
  3. I wanted to ensure that I respected copyright when I was finetuning the model. That was why I chose historical philosophers whose writings are in the public domain. It will take me some time to find data sets of 'character' dialogue that I am allowed to train a model on.

Time-willing (as we're halfway through November), I'd like to do this, but I can't guarantee that I can finish within the month.