Dungeons & Dragons and ChatGPT

Tags

,

A Large Language Model Use Case

If you are not familiar, Dungeons & Dragons (D&D) is a game of storytelling and adventure. It is perhaps ultimately open ended. You do not “win” a game of D&D, so much as you engage in a story as one character within it, shape it from within, and take action within new and ever-changing circumstances as the game continues over weeks, months, or years. One of the players is tasked with being the Dungeon Master (DM). Really this person is just responsible for doing the greater share of establishing the environment, or the world in which the story takes place. The DM also plays the part of every other character in the world not played by the other players, such as the village blacksmith, the wizard that lives on the hill, the innkeeper, and the band of murderous Orcs. The DM establishes the overall story. Between all the players, and some dice, you jointly discover how the story turns out.

This can create the most delightful burden on the Dungeon Master to come up with backstories for different characters, create locations, interesting villains, plots, social and political hierarchies, geography, and so on and so on. “Delightful” because it can be a very enjoyable, though never ending task. I have been running D&D games for decades, and my latest game was becoming very detailed and in depth. Certain storylines revolved around elements of the history of the world being uncovered. This created a LOT of background information to generate. One thing that computers are really good at doing is a lot of work with little complaint.

Large Language Model AI systems such as ChatGPT had recently been in the news. So, I decided to try using ChatGPT to help flesh out the bare bones of what I had already mapped out. These systems use a kind of predictive logic to determine what would be a pleasing response to what it has been asked for. After a little experimentation I established with ChatGPT that we were talking about creating content for a D&D game, and the style of responses I wanted. It has been trained on much of the text on the internet. And it turns out there is a lot of information about Dungeons & Dragons as well as similar games on the Internet. So, it was able to generate a lot of information that was suitable to the genre.

This was also an advantageous use of the platform because I was asking for ideas, rather than facts. The problem (which Microsoft and Google have both spectacularly suffered from in recent weeks) is that just because something is repeated many times on the internet, it doesn’t make it more “factual” than something repeated fewer. Giving these systems ways to determine what is fact and what is not is crucial in not just ranking search results, but in presenting data driven responses. Something that is crucial to those use cases.

For example: what is the height of the Eiffel Tower? It turns out Wikipedia and https://toureiffel.paris both agree on the current total height. That is probably correct, they are good sources. If a different height appeared on 3 or 300 other websites, training these language models which to treat as fact and which not to, is obviously a potentially challenging process.

My interest was only in facts regarding a world that was, itself, imaginary. So, completely avoiding that issue. These things I could specifically instruct ChatGPT to know, and to take into account. It could then use them as established context for responses it gave me. This is actually something that has specifically been improved in releases in late December and mid January. As a result, I have a saved chat session in my account that is many dozens of “pages” and has a huge established context. Though, it is an experimental system and it will, from time to time, need reminding of certain facts.

This has become a fairly pleasing, and surprisingly functional, ongoing discussion in which I instruct it with details of plots or characters that are upcoming and I can ask it to fill in blanks. In this way it acts like a tireless cowriter, always willing (outages aside) to come back with yet another idea. Willing to create yet another list of name options for a new important character or faction or place, and willing to suggest a whole new list of important landmarks for a new town to be added to the map. I take these, select what I want, adjust, and fold it into my planning. if I don’t like what comes back, I can ask for adjustments, or change my approach, or discard. Or I simply use it as a springboard for my own design.

Because ChatGPT uses vast amounts of existing text as a basis for what it generates one could argue it can tend to lean in to tropes of the genre. Even tending to come up with similar names again and again. For example, it is not hard to sense influences of Tolkien and his languages often, as well as previous publications for D&D, as you would expect. But, I see this as suitable for its role in the process. If you defy the genre too much you are simply telling a story in a different genre. Having a co-writer that will adhere to the expectations of the genre allows me to choose when and how to subvert it, or take surprising turns from it.

Further, the rapidity with which this can be done has allowed me to plan elements further into the future and flesh out more of the invented past than I normally would, and in a level of detail that I had not before. I can still feel free to improvise as the story unfolds (and still sometimes have to, when story turns are unexpected). And, because the work overhead is low, anything I discard or radically change or use only a small part of is perfectly fine. No great cost in time or effort is wasted. I can delve far into the backstory of a character that has turned up a couple of times to give myself a greater understanding of them, even though it is possible the story will never lead back to them. If it does, I have plenty of details filed away to draw on as they become relevant.

One interesting experience I had was with an upcoming storyline. I had laid a lot of groundwork for a certain event to happen to the characters, at a particular place and time. And had planned for several other characters to be present, both as antagonists, observers, and potential allies. After laying out the characters (some of them built with the help of ChatGPT) and the location and event they would be attending I informed it of the specific plot turn that was planned to occur. As part of it’s typical upbeat and affirming response it went on to outline how it felt each of those characters would react, and what it thought their priorities would be as they responded. Very pleasingly, this was very close to what I had planned for those characters. Responses I had been careful not to forecast to it previously.

One thing I believe about good storytelling is that characters should act consistently within themselves, even when their circumstances are unexpected. When characters make choices we don’t understand it is hard to empathise with them or to take what they are responding to seriously. This indicated to me that the characters we had a shared understanding of, we had the same conclusions about their responses. That is, they would act consistently. Hopefully the plot turn itself will be the surprise, but the world around it will seem all the more real because it’s inhabitants will respond in character.

Of course, it is possible that this response had been seeded in the information I had provided, and I was experiencing a mirroring in this response. Even if so, I felt it indicated a degree of internal consistency in my plans, characters and world-building.

There has been a lot of talk about the power of Large Language Model AI Chatbots, what they can do and whose jobs they will replace. Because we as humans like to have interactions in language, in text, the very convincing way these pieces of software respond to us makes it easy to believe they are capable of far more than they truly are. What they are capable of, really, is emulating things that they can absorb vast amounts of. Like an infant generating a first attempt at a word after listening to months of human speech. When all you are asking of it is to generate content of a certain style within some parameters, it is very well suited for purpose. That process of absorption and emulation is ideal for that task, as you want the output to be unexpected in some ways. When asked to make real world decisions or determine specifics based on the sum total of the text on the internet, it becomes very problematic. Large Language Model developers are already working on ways they can exclude earlier outputs from Large Language Model AIs from new training sets. They don’t want newer versions of the AIs to be swayed by the incorrect output of older AIs. I think this is indicative of how Large Language Model training can be useful, and where it should be avoided.

Some References:

Long overdue revisited MCU watching order

Tags

, ,

So, I blogged here a while ago about the order in which to watch the various installments of the Marvel Cinematic Universe. It was a simpler time. The Infinity Saga was maybe only half formed.
But still, there was enough to take a good chunk of time to catch up on. Now, with Disney+ recently launched, this might be the best time to revisit this list.
Now, the sheer size of the MCU is even more intimidating. And that is a statement that will seem naive in a couple years.
Anyway, without further delay here is my updated suggested order:

  • Captain America: The First Avenger
  • Agent Carter Seasons 1 & 2
  • Iron Man
  • The Incredible Hulk
  • Iron Man 2
  • Marvel One Shot: A Funny Thing Happened On The Way to Thor’s Hammer (on Captain America: The First Avenger BluRay/DVD)
  • Thor
  • Marvel One Shot: The Consultant (on Thor BluRay/DVD)
  • The Avengers
  • Marvel One Shot: Item 47 (on The Avengers BluRay/DVD)
  • Iron Man 3
  • Marvel One Shot: Agent Carter (on Iron Man 3 BluRay/DVD)
  • Agents of SHIELD Season 1 Episodes 1-7
  • Thor: The Dark World
  • Marvel One Shot: All Hail The King (on Thor:The Dark World BluRay/DVD)
  • Agents of SHIELD Season 1 Episodes 8-16
  • Captain America: The Winter Soldier
  • Agents of SHIELD Season 1 Episodes 17-22
  • Guardians of the Galaxy
  • Agents of SHIELD Season 2 Episodes 1-19
  • The Avengers: Age of Ultron
  • Agents of SHIELD Season 2 Episodes 20-22
  • Ant-Man
  • Captain America: Civil War
  • Spider-Man: Homecoming
  • Guardians of the Galaxy: Vol 2
  • Doctor Strange
  • Thor: Ragnarok
  • Black Panther
  • Avengers: Infinity War
  • Ant-man and the Wasp
  • Captain Marvel
  • Avengers: Endgame
  • Spider-Man: Far From Home

The Netflix Shows operate pretty separately, and don’t tie in closely to the MCU films. They all take place after Avengers, with the later series (Jessica Jones Season 2, Defenders, etc) taking place after Avengers Age of Ultron. However, apart from that they can basically be watched in their order of release.

  • Daredevil Season 1
  • Daredevil Season 2
  • Jessica Jones Season 1
  • Luke Cage Season 1
  • Iron Fist Season 2
  • Defenders
  • The Punisher Season 1
  • Jessica Jones Season 2
  • Luke Cage Season 2
  • Iron Fist Season 2
  • Daredevil Season 3
  • Jessica Jones Season 3
  • The Punisher Season 2

Similarly later seasons of Agents of SHIELD stop tying in quite so closely to the MCU and can be watched in whatever order relative to the rest of the MCU. The same can be said for marvel’s Runaways and the Cloak & Dagger series. Both are quite good, but don’t tie closely in to the MCU happenings. Though, they are intended to be in the same world. Inhumans should be skipped altogether.

Census 2016 – A few thoughts

Tags

,

So the census website gave us all something to laugh or cringe or rage at in some measure over the last 24 hours. If you are seeing this, you probably saw I had some things to say about it. Some in jest. Some less so. But what happened?

There are stories out this morning that the site was hacked. First of all, if I could ask the ABS to never be so stupid as to use that phrase again, that would be great. When people already have privacy concerns with the data being gathered using a generic chronically misunderstood term like “hacked” just makes you look terrible and the data insecure. Of course people have always had privacy concerns about the census, but when you are now asking for identifying information they are all the more valid.

A little more reading indicates the “hacking” was really a series of Denial of Service (DOS or Distributed Denial of Service – DDOS) attacks. At least as far as the information I am seeing. When you say “hacked” a lot of people envisage some teenage techie savant, or foreign government spy breaking into the system and copying everything to an elaborate USB stick (in fact, that is the definition). But that is not what a Denial of Service attack is. A DOS is simply an attempt to make a system so busy or overloaded it can’t be used by anyone. Just like the first 2 minutes after Ticketmaster puts Beyonce tickets on sale. Or a thousand extra people turning up to catch your train. Suddenly there is no room for you. It just gets too busy. The distinct difference is that any data stored by the website previously is generally no less secure after or during a DOS attack than it was otherwise. This is why just saying “hacked” is a terrible idea.

So, what did happen?

Well, I wasn’t there in the room, so I don’t know. What I do know is that they claim the site was taken down as a security measure after the DOS attacks. Not unreasonable. But why  then was I able to finally get a page at 11pm. Was it brought back up after only a couple of hours? And why did that page then tell me to try again in 15 minutes?

I think they were just too busy. Much too busy. Did they get hit by a DOS? Yeah, could well be. If so, I don’t know that they coped very well. Where did that DOS come from? I don’t know… who has an interest in that not going well? Though, of course, dickhead anarchists are dickhead anarchists sometimes.

Here is my problem…

“In the lead-up to census night, the ABS spent hundreds of thousands of dollars on load testing and said its servers could handle 1 million forms per hour.”

ABC Online (http://www.abc.net.au/news/2016-08-10/australian-bureau-of-statistics-says-census-website-hacked/7712216)

This seems to be true. A quick look at the government tenders website last night indicated to me probably over half a million dollars was spent on load testing the census site. But here is the thing about testing: What if you find something you don’t know how to fix? Or you only find 99% of the issues?

I still haven’t seen the whole site working (for obvious reasons), so it’s a very initial guess. But, does it look to me like the site was on the most efficient technology and deployed the most scalable way? No, not really. But they certainly tried to scale. Did they learn anything from the Obamacare rollout or even from ClickFrenzy or any of the other mass site failures that have been seen very often here and sometimes abroad? I don’t know. I would have hoped so. The result suggests not enough at least.

I also have a problem with the figure from the quote above. 1 million forms per hour. That’s 278 per second. Seems like a lot. Indeed, it is. It’s not really enough, though, is it?

Numbers I saw indicated they expected up to 16 million census responses. That seems high. There are only about 9 million households in Australia. Lets say that has grown a bit and there are 10 million. And we are all “supposed” (not technically required) to fill in our census Tuesday night. Lets say a few get in early, during the day or whatever. Maybe 2 million. Maybe a million will mail in the form. That leaves 7 million to try and fill out their forms probably in the 3 hours between 6 and 9pm (don’t want to leave it too late!) on the specified night. Yeah, well over 2 million an hour. Maybe they are more spread out… but we would probably still see a bunch of attempts around 7-8 o’clock. You might expect a peak around that time of 3 million/hour? I think that’s reasonable. So, 1 million an hour is actually quite inadequate. Furthermore, as people experience failures and come back to try again “15 minutes later” that simply increases load for those already trying those 15 minutes later.

There may have been attacks. If so, your data is probably as safe as it ever was. But, it doesn’t seem like they were really prepared for an operation on this scale. No, let me be clear. This is no reason to defund or attack the ABS. There are maybe people there who made some dumb decisions, but maybe they got the best advice available from the closest things to experts available. And maybe they were just wrong, or inadequate for the scale of the task. Regardless, the ABS still performs a critical role in the management of this country and crippling them will not help them do that job better.

Anyway, it’s the morning after census night. Mine hasn’t been lodged (I will try in 4 days – https://twitter.com/rossmack/status/763018667059650564) and who knows what really went on, but that’s my 2 cents. I guess we will find out more in the coming days.

A Super Quick Redirector for Short Links

Tags

, , ,

Featured imageI decided the other day that I wanted a better way to share content with people. Whether it be a PDF or a youtube URL, or something out of my dropbox. Now, none of that is difficult, I will grant you. It’s pretty easy to email or SMS someone a link, even a longer dropbox content link or one of those expansively long blog links generated from the title. Sure, great for SEO, a real pain to dictate to someone over the phone. And you always take the chance their email app or server or whatever will crush the link into a ball of twisted metal.

So, it seemed to me there must be a way to do this better and in a reusable way. And would it hurt if I enhanced my own branding a little (eg huff.po, nerdi.st, hlp.sc, tmblr.co, wp.me) ? Maybe, but let’s assume not.

Better yet, if I set this up in a way that I can easily configure and maintain the redirections from anywhere, that’s a bonus.

It occurs to me that I can do all this with Edge80 without having to worry about development tools or deployment or servers or whatever. And not having to worry about commissioning or deployment is one of my favourite things. Better than raindrops on roses.

So, my basic plan is to use a nice short domain and to have short, simple paths essentially resolve redirects to longer URLs. That way the minimum processing needs to take place. For example if I were to attempt to proxy content, this would require me to do processing and URL changes when handling things like youtube URLs. The Edge80 libraries make that easy, but it’s not necessary for this use. Here we just want to make sure people end up in the right place.

It’s actually pretty easy to return a redirect (301) in Edge80, which is the pivotal part of what we want to do. Let’s look at the code to return a redirect to edge80.com.

<rule name="a_redirect">
  <set-cache aggressive="true" cookies="ignore" insecure="true"/>
    <compose>
      <header name="Location" value="http://www.edge80.com"/>
      <script>
        <![CDATA[
        document.responseCode = 301;
        ]]>
      </script>
    </compose>
  </rule>

The way I decided to configure this is to put some paths and associated URLs in a text file. Here is an example:

e80vids,https://www.youtube.com/channel/UCaa_-DZyObm7ZHAMMEmoRUA
e80els,http://doc.edge80.com/XML/Resource/Elements
henge,https://www.google.com.au/maps/place/Stonehenge/@51.178882,-1.826216,17z/data=!3m1!4b1!4m2!3m1!1s0x4873e63b850af611:0x979170e2bcd3d2dd

I drop this in the public folder of my dropbox for convenience. It’s such a quick and easy way to HTTP share a file, it suits this circumstance quite neatly. I can easily add redirects to the file wherever I am, even on my phone. I then add some code to the Edge80 script to pull this file when needed, and parse it for paths to redirect to.

First, a setting to know where to get the file of redirections.

<rule name="definitions" priority="-100">
  <prerequisite>
    <defmac name="links_src" value="https://dl.dropboxusercontent.com/your_dropbox_account/links.txt" />
    <!-- A Default place to redirect to. -->
    <defmac name="redirect" value="http://www.edge80.com" />
  </prerequisite>
</rule>

Then when a path comes in we look up in this file and decide on a destination URL using some javascript.

<rule comment="Standard Redirect Rule" match-host="*">
  <apply name="definitions" />
    <!-- Some standard aggressive caching. -->
    <set-cache aggressive="true" cookies="ignore" insecure="true"/>
    <compose buffer="links">
      <!-- Fetch the links config file into a buffer called links -->
      <fetch type="url" url="${links_src}"/>
    </compose>
    <compose>
      <script>
        <![CDATA[
        var lines = dombufs['links'].value.split('\n');
        for (var n = 0; n < lines.length; n++) {
          if (lines[n].length > 2 && lines[n].search(",") > -1) {
            var key = lines[n].split(',')[0];
            if (key == request.path.substr(1)) {
              macros.redirect = lines[n].substr(key.length+1);
            }
          }
        }
        document.responseCode = 301;
      ]]>
    </script>
    <header name="Location" value="${redirect}"/>
  </compose>
</rule>

Because the result is cached aggressively this same 301 result will be returned on subsequent requests for the same path, until the cache expires. So, even though there is a little script run on each of the first requests for each path, the caching makes subsequent requests for the same thing very very speedy indeed.

Want to see it at work? The links given as samples above are, of course, live. Try them here:

And you can download the complete Edge80 source code for this little utility at http://rjm.link/redirector (Right Click to save for best result)

Watching the Marvel Cinematic Universe

Tags

, ,

Marvel Cinematic Universe

Marvel cinematic Universe, by mrsteiners.deviantart.com

I have been asked a few times “Avengers was good, what else should I watch?” or “What should I watch before Agents of SHIELD?“. Of course, the answers for these can vary a bit depending on the source of the query. Peoples personal preferences being what they are.

Anyway, as a result of some of these sorts of queries, I have spent a few moments putting together a somewhat canonical list of what I consider a reasonable order in which to watch the Marvel Cinematic Universe up to now (between the end of Agents of SHIELD season 2, part 1 and the premiere of Agent Carter). Surely I will have some reason to update this list in the near future.

I try to minimise disc changes, but put everything in the correct continuity. The most radical change from the order of release is moving Captain America The First Avenger first, but I think it works at least equally well there and helps inform Iron Man 2, in particular. I have also tried to reduce unnecessary disc changes. Oh, and I have included the Marvel One Shot short films which flesh out some bits and pieces and/or have some cool stuff along the way, I also note which disc you can find them on.

Anyway, here it is:
  • Captain America: The First Avenger
  • Iron Man
  • The Incredible Hulk
  • Iron Man 2
  • Marvel One Shot: A Funny Thing Happened On The Way to Thor’s Hammer (on Captain America: The First Avenger BluRay/DVD)
  • Thor
  • Marvel One Shot: The Consultant (on Thor BluRay/DVD)
  • The Avengers
  • Marvel One Shot: Item 47 (on The Avengers BluRay/DVD)
  • Iron Man 3
  • Marvel One Shot: Agent Carter (on Iron Man 3 BluRay/DVD)
  • Agents of SHIELD Season 1 Episodes 1-7
  • Thor: The Dark World
  • Marvel One Shot: All Hail The King (on Thor:The Dark World BluRay/DVD)
  • Agents of SHIELD Season 1 Episodes 8-16
  • Captain America: The Winter Soldier
  • Agents of SHIELD Season 1 Episodes 17-22
  • Guardians of the Galaxy
  • Agents of SHIELD Season 2 Episodes 1-10

Happy watching!