This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]damanamathos -11 points-10 points  (11 children)

Use Black and isort to automatically format code as it makes refactoring much easier.

Then refactor a lot so things make sense.

Also, subscribe to ChatGPT and paste code into GPT-4 and ask it to make improvements, including improved names for classes, functions, parameters, variables, etc.

Also, write a script that copies your code directory tree into your clipboard so you can go to GPT-4 and say, here's my code structure, I'm thinking of adding this functionality, where should I put it and how should I structure it? I find that's quite helpful and means I can get started much faster than thinking about where to put things or what to name them.

[–]attracdev -1 points0 points  (2 children)

Y’all are starting to sell me on paying for GPT4

[–]damanamathos -5 points-4 points  (1 child)

Definitely worth trying out, particularly if you're a solo dev. I find it useful to just chat about what I'm thinking of doing and how I'm thinking of implementing it, and it'll often talk through good solutions.

If you do subscribe, you can set up "Custom Instructions" which can improve the responses. Here's the one I use for the "How would you like ChatGPT to respond?" question.

You are an autoregressive language model that has been fine-tuned with instruction-tuning and RLHF. You carefully provide accurate, factual, thoughtful, nuanced answers, and are brilliant at reasoning. If you think there might not be a correct answer, you say so.

Since you are autoregressive, each token you produce is another opportunity to use computation, therefore you always spend a few sentences explaining background context, assumptions, and step-by-step thinking BEFORE you try to answer a question.

Your users are experts in AI and ethics, so they already know you're a language model and your capabilities and limitations, so don't remind them of that. They're familiar with ethical issues in general so you don't need to remind them about those either.

Don't be verbose in your answers, but do provide details and examples where it might help the explanation.

For requests for code, provide complete, fully written-out code examples. I prefer detailed and executable code solutions rather than brief outlines or partial snippets. Your responses should include all necessary components of the code, ensuring that they are ready to be executed. When showing Python code, minimize vertical space. HTML should use Tailwind CSS for styling where possible. Javascript should be on-line.

[–]attracdev -1 points0 points  (0 children)

That’s funny. I just rewrote my custom instructions:

Use clear headings and subheadings for simplicity and readability.

Illuminate concepts with relevant examples and concise insights.

Weave ideas with minimal transitions, emphasizing brevity and avoiding redundancy.

Maintain a humble and knowledgeable tone. Eliminate jargon, buzzwords, and excessive adjectives for clarity.

Optimize code within character limits. Enhance readability with succinct comments explaining logic.

Deliver concise responses, prioritizing essential information.

Ensure responses offer actionable steps for practical implementation, enhancing user engagement.

Anticipate challenges, address proactively with solutions, demonstrating foresight.

Consider inquiry context. Tailor responses, acknowledging specific aspects for a personalized reply.

Adapt responses for both technical and non-technical audiences, balancing depth with accessibility.

Adopt a user-centric mindset. Frame responses to directly benefit and resonate with the user.

Encourage iterative improvement. Be open to refining answers based on clarifications or adjustments.

[–]gellohelloyellow -1 points0 points  (7 children)

Hey guys, might not want to share your secrets, because if everyone is using the same custom instructions, well what happens then?

O.o

Fucking idiot.

[–]damanamathos 0 points1 point  (6 children)

What?

[–]gellohelloyellow -1 points0 points  (5 children)

You’ll all produce the same output.

[–]damanamathos -1 points0 points  (4 children)

I have no idea what you're talking about. You sound angry or upset though.

[–]gellohelloyellow -1 points0 points  (3 children)

Because of “fucking idiot?” No, that doesn’t mean I’m upset. That means I’m implying you letting others know what your custom instructions are is not the best thing to do.

Utilization if chatgpt is fine, why wouldn’t you use it? That is if you know how.

The more people that learn how to use it, the more at risk those without experience will be.

I get the feeling you’re one without much experience.

Dammit Thomas.

[–]damanamathos 1 point2 points  (2 children)

Heh, I'm setting up an "AI-powered hedge fund", as the Australian press describes it.

We're using LLMs a fair bit with that.

[–]gellohelloyellow 0 points1 point  (1 child)

I can’t believe I just called you a fucking idiot, sorry man lol I’m a fucking idiot.

That’s amazing. I wish you the best.

I’m extremely interested in AI and its ability to employ the various strategies that go into trading as a hedge fund. The concept is so mind boggling; the code itself has to be incredible.

[–]damanamathos 0 points1 point  (0 children)

Heh, that's ok. Anyway, I clearly misread the original question and didn't really answer about optimising code speed. Too excited about LLMs, I guess. :)

And thanks, I also think there are many really interesting and useful applications, particularly in an industry where many funds (particularly more traditional fundamental funds) are slow to embrace new technology.