First, note that these features appear only on nonimmigrant visas; immigrant visas have a completely different format and do not contain either the asterisks or the four-digit number.
I strongly suspect you will probably never find out what these mean as the purposes of these fields are most likely classified. Direct questions put to U.S. consular officials about the stars and four-digit number have, as far as I can tell, never gotten a straight answer. They have gotten evasions such as "not of any significance" and "the stars on a U.S. visa are among the normal features of a U.S. visa."
Officially, the features do not exist. Guidance on the US State Department web site does not acknowledge their existence:
Based on a survey of images of US visas found on Google, I believe these features were introduced sometime between 1999 and 2000. I was able to find visas issued in 1999 without the features, and visas issued in 2000 with the features, including this well known visitor who never left.
In issuing visas, consular posts follow rules laid down in chapter 9 of the Foreign Affairs Manual, in which the US State Department's procedures are laid out. These are based on various sections of the Code of Federal Regulations.
In the case of issuing nonimmigrant visas, this is covered by 9 FAM 41.113, which tells consular officers how to issue a visa in accordance with the regulations at 22 CFR 41.113. The relevant section is the very first one:
9 FAM 41.113 PN1 INFORMATION ABOUT THE MACHINE READABLE VISA (MRV)
The information on the MRV is printed on an adhesive foil and consists
of five sections that:
- Reflect the applicant’s biographic data;
- Contain information about the visa itself (visa type, number of entries, date of issuance, and date of expiration);
- Show the 88-character field used for annotating additional information about the recipient, when necessary; (e.g., annotation of
a petition number, SEVIS number, etc.);
- Display a digitized photo of the visa recipient; and
- Contain a machine-readable zone (MRZ) consisting of two lines of highly sensitive coded data. Scanners connected to authorized computer
networks can read the data located in the MRZ and instantly recall
records associated with the MRV. Damage to either line may prevent the
scanner from reading the data, requiring manual data-entry before
processing, which could lead to delays at ports of entry. You should
instruct MRV recipients to take care with their MRVs, avoiding folding
the foil, and preventing contact between the foil and objects that
could damage it, such as paper clips, staples, etc.
Note that no mention is made here, or anywhere else in the unclassified parts of 9 FAM, about the asterisks or the four-digit number. Those parts of the visa do not appear to be relevant to whether the visa holder is of any particular concern to US authorities. In particular, it does not appear to indicate that the visa holder poses any particular level of "risk". This also appears to be the opinion of various immigration lawyers.
After reading a lot of other sections of 9 FAM and 22 CFR, and some versions at archive.org going back to before 2000, I am pretty well convinced that while these features do serve a purpose, that purpose is classified and appears only in a classified section of 9 FAM, if at all.
One last thing I can tell you for sure is that the four digit number is not binary. Numerous examples can be seen on Google Images of visas with four-digit numbers containing digits other than 0 or 1, though these appear to be far less common.